Comparing version 0.3.2 to 0.4.0
@@ -6,13 +6,5 @@ // Generated by CoffeeScript 1.6.3 | ||
var tzid, zone, zones, _fn; | ||
moment.formats = { | ||
day: 'YYYY-MM-DD', | ||
numberedDay: 'YYYYMMDD', | ||
calendarDay: 'YYYY/MM/DD', | ||
abbrv: 'ddd, MMM Do', | ||
long: 'dddd, MMMM Do', | ||
short: 'MMM D', | ||
weekday: 'dddd' | ||
}; | ||
moment.formats = require('../data/formats.json'); | ||
moment.day = function(day, tzid) { | ||
return moment.tz(day, [moment.formats.day, moment.formats.numberedDay], tzid); | ||
return moment.tz(day, [moment.formats.day, moment.formats.iCalDay, moment.formats.slashDay], tzid); | ||
}; | ||
@@ -19,0 +11,0 @@ moment.fn.dayString = function() { |
{ | ||
"name": "geomoment", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"description": "moment-timezone, if moment-timezone forced you to choose a particular moment in time. also, some extra sugar.", | ||
@@ -8,3 +8,3 @@ "main": "lib/index.js", | ||
"test": "./node_modules/.bin/mocha --compilers coffee:coffee-script spec/*.spec.coffee", | ||
"pretest": "./node_modules/.bin/coffee --bare --compile --output lib/ src/" | ||
"pretest": "./node_modules/.bin/coffee --bare --compile --output lib/ src/ && ./node_modules/.bin/coffee util/document_date_formats.coffee" | ||
}, | ||
@@ -11,0 +11,0 @@ "repository": { |
@@ -20,10 +20,4 @@ # geomoment | ||
// Date formats | ||
// Date formats (see below for a complete list) | ||
geomoment.formats.day = 'YYYY-MM-DD' // 2013-01-01 | ||
geomoment.formats.numberedDay = 'YYYYMMDD' // 20130101 | ||
geomoment.formats.calendarDay = 'YYYY/MM/DD' // 2013/01/01 | ||
geomoment.formats.abbrv = 'ddd, MMM Do' // Tue, Jan 1st | ||
geomoment.formats.long = 'dddd, MMMM Do' // Tuesday, January 1st | ||
geomoment.formats.short = 'MMM D' // Jan 1 | ||
geomoment.formats.weekday = 'dddd' // Tuesday | ||
``` | ||
@@ -34,1 +28,92 @@ | ||
Use `lib/client.js` with [browserify](https://github.com/substack/node-browserify). USA timezones included only for now. | ||
Also recommended: [geomoment-angular](https://github.com/goodeggs/geomoment-angular) for use in an [angular.js](http://angularjs.org) project. | ||
## date formats | ||
<table> | ||
<tr> | ||
<th>day</th> | ||
<td>2013-12-06</td> | ||
<td><code>YYYY-MM-DD</code></td> | ||
</tr> | ||
<tr> | ||
<th>time</th> | ||
<td>11:12</td> | ||
<td><code>HH:MM</code></td> | ||
</tr> | ||
<tr> | ||
<th>dayTime</th> | ||
<td>2013-12-06 11:12</td> | ||
<td><code>YYYY-MM-DD HH:MM</code></td> | ||
</tr> | ||
<tr> | ||
<th>iCalDay</th> | ||
<td>20131206</td> | ||
<td><code>YYYYMMDD</code></td> | ||
</tr> | ||
<tr> | ||
<th>iCalTime</th> | ||
<td>111226</td> | ||
<td><code>HHmmss</code></td> | ||
</tr> | ||
<tr> | ||
<th>iCalDayTime</th> | ||
<td>20131206T111226</td> | ||
<td><code>YYYYMMDD[T]HHmmss</code></td> | ||
</tr> | ||
<tr> | ||
<th>slashDay</th> | ||
<td>12/06/2013</td> | ||
<td><code>M/DD/YYYY</code></td> | ||
</tr> | ||
<tr> | ||
<th>shortSlashDay</th> | ||
<td>12/06</td> | ||
<td><code>M/DD</code></td> | ||
</tr> | ||
<tr> | ||
<th>shortDay</th> | ||
<td>Friday, Dec 6</td> | ||
<td><code>dddd, MMM D</code></td> | ||
</tr> | ||
<tr> | ||
<th>abbrvDay</th> | ||
<td>Fri 12 6</td> | ||
<td><code>ddd MM D</code></td> | ||
</tr> | ||
<tr> | ||
<th>longDay</th> | ||
<td>Friday, December 6, 2013</td> | ||
<td><code>dddd, MMMM D, YYYY</code></td> | ||
</tr> | ||
<tr> | ||
<th>weekday</th> | ||
<td>Friday</td> | ||
<td><code>dddd</code></td> | ||
</tr> | ||
</table> | ||
## license | ||
The MIT License (MIT) | ||
Copyright (c) 2013 Good Eggs Inc. | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11847
12
141
118