In addition to moment source code a bundled version with all languages will be available for download on momentjs.com. The files will be available in min/moment+langs.js
and min/moment+langs.min.js
.
Custom bundles can be generated with
grunt embed_languages uglify --embed_languages=en-gb,fr-ca,de
which would generate min/moment+customlangs.js
and min/moment+customlangs.min.js
.
bower support
Good news for all bower users. moment is now registered in the bower registry!
- issue 1055
Moment objects can now be created with an object:
moment({years: 2010, months: 3, days: 5, hours: 15, minutes: 10, seconds: 3, milliseconds: 123})
moment({year: 2010, month: 3, day: 5, hour: 15, minute: 10, second: 3, millisecond: 123})
moment({y: 2010, M: 3, d: 5, h: 15, m: 10, s: 3, ms: 123})
moment({hour: 15, minute: 10})
- issue 1011
Now the following code would work:
moment.lang("it");
moment("01/03/2013", "L"); // L maps to DD/MM/YYYY
moment.lang("en");
moment("03/01/2013", "L"); // L maps to MM/DD/YYYY
- issue 915
After detecting an invalid a moment with moment.fn.isValid()
, the actual invalid component can be extracted with invalidAt
- issue 938
moment().get('date'); // moment().date()
moment().set('date', 5); // moment().date(5)
- issue 912
This is pretty helpful when creating a moment and omitting year, month, day in the format.
moment("15", "HH") // today at 15 o'clock
moment("5 15", "DD HH") // this month, 5 day 15 o'clock
moment("Feb 6 15", "MMM DD HH") // this year, 6th February, 15 o'clock
No more style issues in all tests ... yeey!
- issue 1021
Returns whether the current timezone offset is a multiple of 60 minutes (1 hour). Mainly to use in tests, so they don't break in weird timezones.
language files converted to UMD
- issue 1012
All files in lang/*.js
are now implemented with the UMD pattern, meaning they just-work (tm) in amd, cjs (node) and browser environments.
- lowercase months and days in Danish translation 1051
- added Russian month cases 942
- fixed isPM for IE7 and IE8 Quirks mode 1033
- norwegian translation fixes 1022
moment.fn.calendar
now respects timezone information 1019- fixed hebrew dual form 998
moment.utc
now works when cloning moments 1007- some test improvements, so they don't break in weird timezones
- fixed short month/weekday names in Ukranian 1002
- language identifiers are case and dash insensitive 985
- fixed norwegian nynorsk L/l date format 966
- durations can now be created with scring values for component keys 979
- fixed a weird parsing issue related to RegExp#test remembering last matc position 971
- ASP.net duration format now correctly handles days 910
- integers are converted to strings in moment string + format constructor 930
- startOf/same/endOf now suppoer isoWeek 918
- setting non-existend language doesn't crash in browsers 6673d2c08
moment.lang(key, null)
uninstalls a language definition (useful in tests)