Khoảng khăc. js đã được sử dụng thành công trong hàng triệu dự án và chúng tôi rất vui vì đã góp phần làm cho ngày và giờ tốt hơn trên web. Tính đến tháng 9 năm 2020, Moment nhận được hơn 12 triệu lượt tải xuống mỗi tuần. Tuy nhiên, Moment được xây dựng cho kỷ nguyên trước của hệ sinh thái JavaScript. Web hiện đại ngày nay trông khác nhiều. Moment đã phát triển phần nào trong những năm qua, nhưng về cơ bản nó vẫn giữ nguyên thiết kế như khi nó được tạo ra vào năm 2011. Dựa vào số lượng dự án phụ thuộc vào nó, chúng tôi chọn ưu tiên tính ổn định hơn các tính năng mới
Ví dụ, xem xét rằng các đối tượng Khoảnh khắc có thể thay đổi. Đây là một nguồn khiếu nại phổ biến về Moment. Chúng tôi giải quyết vấn đề này trong hướng dẫn sử dụng nhưng nó vẫn gây ngạc nhiên cho hầu hết người dùng mới. Thay đổi Khoảnh khắc thành bất biến sẽ là một thay đổi đột phá đối với mọi dự án sử dụng nó. Tạo một "Moment v3" không thay đổi sẽ là một công việc to lớn và sẽ biến Moment thành một thư viện hoàn toàn khác. Vì điều này đã được thực hiện trong các thư viện khác, chúng tôi cảm thấy rằng điều quan trọng hơn là giữ lại API có thể thay đổi
Một lập luận phổ biến khác chống lại việc sử dụng Moment trong các ứng dụng hiện đại là kích thước của nó. Khoảnh khắc không hoạt động tốt với các thuật toán "rung cây" hiện đại, do đó, nó có xu hướng tăng kích thước của gói ứng dụng web. Nếu một người cần hỗ trợ quốc tế hóa hoặc múi giờ, Moment có thể khá lớn. Các trình duyệt web hiện đại [và Node. js] hiển thị hỗ trợ quốc tế hóa và múi giờ thông qua đối tượng
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
68, được mã hóa thành ECMA-402. Các thư viện như Luxon [và các thư viện khác] tận dụng lợi thế này, giảm hoặc loại bỏ nhu cầu gửi các tệp dữ liệu của riêng bạnGần đây, Chrome Dev Tools đã bắt đầu hiển thị các đề xuất để thay thế Khoảnh khắc cho riêng kích thước. Chúng tôi thường ủng hộ động thái này
Bạn cũng có thể muốn đọc
- Có lẽ bạn không cần thời gian. js nữa
- Bạn không [có thể không] cần Khoảnh khắc. js
- Tại sao bạn không nên sử dụng Moment. js
- 4 lựa chọn thay thế cho thời điểm. js để quốc tế hóa ngày tháng
Nhóm Moment đã thảo luận về những vấn đề này rất lâu. Chúng tôi nhận thấy rằng nhiều dự án hiện tại có thể tiếp tục sử dụng Moment, nhưng chúng tôi không muốn Moment được sử dụng trong các dự án mới trong tương lai. Thay vào đó, chúng tôi muốn giới thiệu các giải pháp thay thế là những lựa chọn tuyệt vời để sử dụng trong các ứng dụng hiện đại ngày nay. Chúng tôi cũng muốn quảng cáo bổ sung
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
69 cho ngôn ngữ JavaScript đang tìm kiếm phản hồi và cộng tác viênHiện tại, chúng tôi thường coi Khoảnh khắc là một dự án kế thừa ở chế độ bảo trì. Nó không chết, nhưng nó thực sự được thực hiện
Trong thực tế, điều này có nghĩa là
- Chúng tôi sẽ không thêm các tính năng hoặc khả năng mới
- Chúng tôi sẽ không thay đổi API của Moment thành bất biến
- Chúng tôi sẽ không giải quyết các vấn đề về rung cây hoặc kích thước bó
- Chúng tôi sẽ không thực hiện bất kỳ thay đổi lớn nào [không có phiên bản 3]
- Chúng tôi có thể chọn không sửa lỗi hoặc hành vi kỳ quặc, đặc biệt nếu chúng là những vấn đề đã biết từ lâu
Liên quan cụ thể đến các tệp ngôn ngữ quốc tế hóa của Moment
- Chúng tôi có thể chọn không chấp nhận các sửa đổi đối với chuỗi bản địa hóa hoặc định dạng ngày được bản địa hóa, đặc biệt nếu chúng đã được lập luận thành công cho biểu mẫu hiện tại của chúng
- Bạn phải đưa ra một lập luận thuyết phục mới cho những thay đổi ngôn ngữ với bằng chứng quan trọng, phi giai thoại để hỗ trợ cho quan điểm của bạn
- Nếu chuỗi hoặc định dạng bạn đang yêu cầu thay đổi được phản ánh trong CLDR, thì bạn phải gửi thay đổi ở đó trước và được chấp nhận
Tuy nhiên, vì chúng tôi hiểu rằng Khoảnh khắc đã được thiết lập tốt trong hàng triệu dự án hiện có
- Chúng tôi sẽ giải quyết các vấn đề quan trọng về bảo mật khi chúng phát sinh
- Chúng tôi sẽ phát hành các bản cập nhật dữ liệu cho Múi giờ theo thời điểm sau khi phát hành cơ sở dữ liệu múi giờ IANA
Reasons to keep using Moment
In most cases, you should not choose Moment for new projects. However there are some possible reasons you might want to keep using it
Browser support
Moment works well on Internet Explorer 8 and higher. By contrast, Luxon only works on IE 10 and higher and requires a polyfill to do so. You can read more in Luxon's documentation
Other libraries have also had issues with Safari, especially on mobile devices. If you have a strong requirement to support older browsers, then you might want to stick with Moment for a bit longer
Tuy nhiên, ngày. js reports compatibility with IE8 and higher so you still may wish to consider that alternative
Dependency by other libraries
Several other libraries, especially date pickers and graphing libraries, take Moment as a dependency. If you are using such a component and cannot find an alternative, then you are already including Moment in your project. Thus, it might make sense to continue using Moment throughout your project rather than including yet another date and time library
Familiarity
If you are a long-time user of Moment, you may already understand its API and limitations well. Nếu đúng như vậy và các vấn đề nêu trên không phải là mối bận tâm của bạn, thì bạn chắc chắn có thể tiếp tục sử dụng nó
Recommendations
editThere are several great options to consider using instead of Moment
When choosing, consider that
- Some libraries are split into modules, plugins, or companion libraries
- Some libraries use the ECMAScript
68 API for locales, time zones, or both// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
- Some libraries still provide their own locale and time zone files like Moment and Moment-Timezone do
Here are the alternatives we recommend
Luxon
Luxon có thể được coi là sự phát triển của Moment. It is authored by Isaac Cambron, a long-time contributor to Moment. Please read Why does Luxon exist? and the For Moment users pages in the Luxon documentation
- Locales.
68 provided// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
- Time Zones.
68 provided// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
Day. js
Day. js is designed to be a minimalist replacement for Moment. js, using a similar API. It is not a drop-in replacement, but if you are used to using Moment's API and want to get moving quickly, consider using Day. js
- Locales. Custom data files that can be individually imported
- Time Zones.
68 provided, via a plugin// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
date-fns
Date-fns offers a series of functions for manipulating JavaScript
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
74 objects. For more details, scroll to "Why date-fns?" on the date-fns home page- Locales. Custom data files that can be individually imported
- Time Zones.
68 provided, via a separate companion library// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
js-Joda
js-Joda is a JavaScript port of Java's Three-Ten Backport, which is the base for JSR-310 implementation of the Java SE 8
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
76 package. If you are familiar with // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
76, Joda-Time, or Noda Time, you will find js-Joda comparable- Locales. Custom data files via add-on module
- Time Zones. Custom data files via add-on module
No Library
JavaScript has always had a
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
74 object, defined ECMAScript [ECMA-262] specification hereWhen using
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
74 objects, be aware of the followingThe
74 object internally represents a Unix timestamp with millisecond precision. It offers functions that will convert to and from the system's local time zone, but it is always UTC internally. Unlike a// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
81 object, it can not be set to use another time zone; It has no concept of "mode"// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
Using
82, or// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
83 has been problematic and implemented inconsistently in the past. The current specification defines parsing a variation of ISO 8601 strings, where date-only forms [like// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
84] are parsed as UTC, instead of local time as they would be by ISO 8601. Even then, not all modern implementations have implemented this specification correctly [e. g. , Safari]. Other types of strings may work, but parsing them is implementation specific and can vary significantly - especially with older browsers. Depending on the implementation, and the components provided in the string, you may be surprised with the result. For these reasons, we agree with MDN's statement that parsing strings with the// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
74 object is strongly discouraged// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
Modern JavaScript environments will also implement the by ECMA-402 specification, which provides the
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
68 object, and defines behavioral options of the // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
74 object's // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
88, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
89, and // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
90 functionsWhen using the
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
68 object, be aware of the following- Not every environment will implement the full specification. In particular, Node. js environments require internationalization support provided by ICU. See the Node. js documentation for further details
- The ECMAScript Intl compatibility table [by kangax] can be useful in determining which features are supported and which are not
- Most newer environments provide IANA time zone support via the
92 option in the// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
93 constructor [and in// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
94,// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
95, and// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
96]. This option can be used to take the internal UTC-based timestamp of a// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
74 object and get a string that has been converted to a named time zone. However, it can not be used to convert a// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
74 object to a different time zone// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
If the
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
74 and // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
68 objects meet your needs and you fully understand their limitations, then you might consider using them directlyThe Future
editTemporal - Better dates and times in the JavaScript language
One day soon, we hope there won't be a strong need for date and time libraries in JavaScript at all. Instead, we will be able to use capabilities of the JavaScript language itself. Though some capabilities are here today with
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
74 and // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
68, we know from experience and data that there is significant room for improvementThe effort to make better date and time APIs in the JavaScript language is being done via The ECMA TC39 Temporal Proposal. It is currently at Stage 3 of the TC39 process
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
69 will be a new global object that acts as a top-level namespace [like // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
604]. Nó hiển thị nhiều loại đối tượng riêng biệt bao gồm // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
605, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
606, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
607, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
608, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
609, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
610 và một số đối tượng khác. Sách dạy nấu ăn tạm thời hiển thị nhiều "công thức nấu ăn" với các ví dụ về cách sử dụng các đồ vật này trong các tình huống khác nhauBạn có thể dùng thử Temporal ngay hôm nay, thông qua một polyfill phi sản xuất. Vui lòng dùng thử, nhưng đừng sử dụng nó trong sản xuất [chưa]
Vui lòng cung cấp phản hồi và cân nhắc đóng góp cho nỗ lực này - đặc biệt nếu bạn có kinh nghiệm sử dụng Khoảnh khắc hoặc các thư viện ngày và giờ khác
Yêu cầu. js
editWe strongly recommend reading this if you plan to use moment with Require. js. Also upgrade to 2. 14. 0 or above for best experience
As a start, you might have acquired moment through bower or node_modules or anything else that places moment. js together with a locales directory in a base folder. Then you should use a tool like adapt-pkg-main, or manually -- using packages config
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
3With the above setup, you can require the core with
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
611 and // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
612 locale with // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
613// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
For more complicated use cases please read excellent explanation by @jrburke
Moment will still create a
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
611 global, which is useful to plugins and other third-party code. If you wish to squash that global, use the // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
615 option on the module config// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
6If you don't specify
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
615 then the globally exported moment will print a deprecation warning. From next major release you'll have to export it yourself if you want that behaviorFor version 2. 5. x, in case you use other plugins that rely on Moment but are not AMD-compatible you may need to add
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
617 to your r. js configNote. Để cho phép khoảnh khắc. js plugins to be loaded in requirejs environments, moment is created as a named module. Because of this, moment must be loaded exactly as as
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
618, using // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
619 to determine the directory. Requiring moment with a path like // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
620 will return // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
621Note. From version 2. 9. 0 moment exports itself as an anonymous module, so if you're using only the core [no locales / plugins], then you don't need config if you put it on a non-standard location
String 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
7When creating a moment from a string, we first check if the string matches known ISO 8601 formats, we then check if the string matches the RFC 2822 Date time format before dropping to the fall back of
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
622 if a known format is not found// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
9Warning. Browser support for parsing strings is inconsistent. Because there is no specification on which formats should be supported, what works in some browsers will not work in other browsers
For consistent results parsing anything other than ISO 8601 strings, you should use String + Format
Supported ISO 8601 strings
An ISO 8601 string requires a date part
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
0A time part can also be included, separated from the date part by a space or an uppercase T
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
1Any of the date parts can have a time part
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
2If a time part is included, an offset from UTC can also be included as
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
623, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
624, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
625 or // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
626// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
7Note. Support for the week and ordinal formats was added in version 2. 3. 0
If a string does not match any of the above formats and is not able to be parsed with
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
82, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
628 will return false// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
0The RFC 2822 date time format
Before parsing a RFC 2822 date time the string is cleansed to remove any comments and/or newline characters. The additional characters are legal in the format but add nothing to creating a valid moment instance
After cleansing, the string is validated in the following space-separated sections, all using the English language
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
0- Day of Week in three letters, followed by an optional comma. [không bắt buộc]
- Day of Month [1 or 2 digit], followed by a three-letter month and 2 or 4 digit year
- Two-digit hours and minutes separated by a colon [. ], theo sau tùy ý là dấu hai chấm khác và giây ở dạng 2 chữ số
- Múi giờ hoặc độ lệch ở một trong các định dạng sau
- UT. +0000
- giờ GMT. +0000
- EST. CST. MST. PST. EDT. CĐT. MDT. PDT. Múi giờ Hoa Kỳ*
- Một - tôi. K-Z. Múi giờ quân sự*
- Thời gian bù +/-9999
[*]Xem phần 4. 3 của đặc điểm kỹ thuật để biết chi tiết
Trình phân tích cú pháp cũng xác nhận rằng ngày trong tuần [khi được đưa vào] nhất quán với ngày
Chuỗi + Định dạng 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
1Nếu bạn biết định dạng của chuỗi đầu vào, bạn có thể sử dụng định dạng đó để phân tích một khoảnh khắc
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
2Theo mặc định, trình phân tích cú pháp bỏ qua các ký tự không phải chữ và số, vì vậy cả hai ký tự sau đây sẽ trả về cùng một thứ
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
3Bạn có thể nhận được kết quả không mong muốn khi phân tích cả ngày và giờ. Ví dụ dưới đây có thể không phân tích cú pháp như bạn mong đợi
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
4You can use strict mode, which will identify the parsing error and set the Moment object as invalid
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
5Mã thông báo phân tích cú pháp tương tự như mã thông báo định dạng được sử dụng trong
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
629Mã thông báo năm, tháng và ngày
Mã thông báo phân biệt chữ hoa chữ thường
InputExampleDescription// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
630// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
6314 or 2 digit year. Ghi chú. Only 4 digit can be parsed on // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
632 mode// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
633// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
6342 digit year// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
635// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
636Year with any number of digits and sign// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
637// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
638Quarter of year. Sets month to first month in quarter. // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
639// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
640Month number// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
641// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
642Month name in locale set by // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
643// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
644// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
645Day of month// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
646// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
647Day of month with ordinal// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
648// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
649Day of year// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
650// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
651Unix timestamp// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
652// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
653Unix ms timestamp// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
630 from version 2. 10. 5 supports 2 digit years, and converts them to a year near 2000 [same as // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
633]// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
635 was added in 2. 11. 1. It will match any number, signed or unsigned. It is useful for years that are not 4 digits or are before the common era. It can be used for any yearWeek year, week, and weekday tokens
For these, the lowercase tokens use the locale aware week start days, and the uppercase tokens use the ISO week date start days
Mã thông báo phân biệt chữ hoa chữ thường
InputExampleDescription// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
657// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
631Locale 4 digit week year// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
659// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
634Locale 2 digit week year// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
661// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
662Locale week of year// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
663// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
664Locale day of week// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
665// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
666Day name in locale set by // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
643// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
668// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
631ISO 4 digit week year// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
670// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
634ISO 2 digit week year// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
672// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
662ISO week of year// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
674// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
675ISO day of weekLocale aware formats
Locale aware date and time formats are also available using
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
676. They were added in version 2. 2. 1, except // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
677 which was added 2. 8. 4Mã thông báo phân biệt chữ hoa chữ thường
InputExampleDescription// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
678// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
679Date [in local format]// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
680// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
681Month name, day of month, year// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
682// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
683Month name, day of month, year, time// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
684// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
685Day of week, month name, day of month, year, time// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
686// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
687Time [without seconds]// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
677// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
689Time [with seconds]Hour, minute, second, millisecond, and offset tokens
Mã thông báo phân biệt chữ hoa chữ thường
InputExampleDescription// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
690// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
691Hours [24 hour time]// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
692// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
640Hours [12 hour time used with // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
694. ]// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
695// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
696Hours [24 hour time from 1 to 24]// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
694// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
698Post or ante meridiem [Note the one character // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
699 are also considered valid]// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
700// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
701Minutes// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
702// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
701Seconds// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
704// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
705Fractional seconds// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
706// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
707Offset from UTC as // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
623, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
624, or // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
626From version 2. 10. 5. fractional second tokens length 4 up to 9 can parse any number of digits, but will only consider the top 3 [milliseconds]. Use if you have the time printed with many fractional digits and want to consume the input
Note that the number of
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
711 characters provided is only relevant when parsing in strict mode. In standard mode, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
711, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
713, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
714, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
715 are all equivalent, and interpreted as fractions of a second. For example, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
716 is always 120 milliseconds, passing // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
713 will not cause it to be interpreted as 12 milliseconds// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
706 were added in version 1. 2. 0// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
719 were added in version 1. 6. 0// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
650 was added in version 2. 0. 0// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
721 were added in version 2. 10. 5// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
695 were added in version 2. 13. 0Unless you specify a time zone offset, parsing a string will create a date in the current time zone
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
6Era Year related tokens
Mã thông báo phân biệt chữ hoa chữ thường
InputExamplesDescriptiony . yyyy// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
723Yearsyo// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
724Ordinal YearsN// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
725Abbr Era nameNN// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
725Abbr Era nameNNN// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
725Abbr Era nameNNNN// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
728Full Era nameNNNNN// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
725Narrow Era nameEra support was added in 2. 25. 0. The tokens/API are still in flux
Notes and gotchas
If the moment that results from the parsed input does not exist,
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
628 will return false// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
7As of version 2. 0. 0, a locale key can be passed as the third parameter to
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
731 and // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
732// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
8Moment's parser is very forgiving, and this can lead to undesired/unexpected behavior
For example, the following behavior can be observed
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
9Previous to 2. 13. 0 the parser exhibited the following behavior. This has been corrected
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
60As of version 2. 3. 0, you may specify a boolean for the last argument to make Moment use strict parsing. Strict parsing requires that the format and input match exactly, including delimeters
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
61You can use both locale and strictness
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
62Strict parsing is frequently the best parsing option. For more information about choosing strict vs forgiving parsing, see the parsing guide
Parsing two digit years
By default, two digit years above 68 are assumed to be in the 1900's and years 68 or below are assumed to be in the 2000's. This can be changed by replacing the
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
733 method. The only argument of this method is a string containing the two years input by the user, and should return the year as an integer// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
63Parsing glued hour and minutes
From version 2. 11. 0 parsing
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
734, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
735, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
736 and // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
737 is supported// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
64String + Formats 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
65If you don't know the exact format of an input string, but know it could be one of many, you can use an array of formats
This is the same as String + Format, only it will try to match the input to multiple formats
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
66Bắt đầu từ phiên bản 2. 3. 0, Moment uses some simple heuristics to determine which format to use. In order
- Prefer formats resulting in valid dates over invalid ones
- Prefer formats that parse more of the string than less and use more of the format than less, i. e. prefer stricter parsing
- Prefer formats earlier in the array than later
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
67You may also specify a locale and strictness argument. They work the same as the single format case
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
68Note. Parsing multiple formats is considerably slower than parsing a single format. If you can avoid it, it is much faster to parse a single format
Array 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
69Bạn có thể tạo một khoảnh khắc với một dãy số phản ánh các tham số được truyền cho new Date[]
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
738// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
70Any value past the year is optional, and will default to the lowest possible number
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
71Construction with an array will create a date in the current time zone. To create a date from an array at UTC, use
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
739// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
72Note. Because this mirrors the native
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
74 parameters, months, hours, minutes, seconds, and milliseconds are all zero indexed. Years and days of the month are 1 indexedThis is often the cause of frustration, especially with months, so take note
If the date represented by the array does not exist,
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
628 will return false// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
73UTC 1. 5. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
74By default, moment parses and displays in local time
If you want to parse or display a moment in UTC, you can use
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
732 instead of // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
731This brings us to an interesting feature of Moment. js. UTC mode
While in UTC mode, all display methods will display in UTC time instead of local time
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
75Additionally, while in UTC mode, all getters and setters will internally use the
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
744 and // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
745 methods instead of the // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
746 and // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
747 methods// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
76It is important to note that though the displays differ above, they are both the same moment in time
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
77Any moment created with
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
732 will be in UTC mode, and any moment created with // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
731 will notTo switch from UTC to local time, you can use moment#utc or moment#local
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
78parseZone 2. 3. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
79Moment's string parsing functions like
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
750 and // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
751 accept offset information if provided, but convert the resulting Moment object to local or UTC time. In contrast, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
752 parses the string but keeps the resulting Moment object in a fixed-offset timezone with the provided offset in the string// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
90It also allows you to pass locale and strictness arguments
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
91// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
753 is equivalent to parsing the string and using // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
754 to parse the zone// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
92Validation 1. 7. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
93Moment applies stricter initialization rules than the
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
74 constructor// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
94You can check whether the Moment considers the date invalid using
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
628. You can check the metrics used by // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
757 using // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
758, which returns an objectThe following parsing flags result in an invalid date
759. An overflow of a date field, such as a 13th month, a 32nd day of the month [or a 29th of February on non-leap years], a 367th day of the year, etc.// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
759 contains the index of the invalid unit to match// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
761 [see below];// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
762 means no overflow// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
763. An invalid month name, such as// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
764. Contains the invalid month string itself, or else null// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
765. An input string that contains nothing parsable, such as// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
766. Boolean// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
767. A// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
768 input, like// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
769. Boolean// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
770. An empty list of formats, such as// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
771. Boolean// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
772. A date created explicitly as invalid, such as// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
773. Boolean// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
In addition to the above, As of 2. 13. 0 the meridiem and parsedDateParts flags work together to determine date validity
774. Indicates what meridiem [AM/PM] was parsed, if any. String// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
775. Returns an array of date parts parsed in descending order - i. e. parsedDateParts[0] === year. If no parts are present, but meridiem has value, date is invalid. Array// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
Additionally, if the Moment is parsed in strict mode, these flags must be empty for the Moment to be valid
776. array of format substrings not found in the input string// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
777. array of input substrings not matched to the format string// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
Note. Moment's concept of validity became more strict and consistent between 2. 2 and 2. 3. Note. Validity is determined on moment creation. A modified moment [i. e.
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
778] will remain validAdditionally, you can use
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
779 to determine which date unit overflowed// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
95The return value has the following meaning
- years
- months
- days
- giờ
- phút
- giây
- mili giây
Ghi chú. Trong trường hợp có nhiều đơn vị sai, đơn vị đầu tiên được trả lại [ví dụ: vì hiệu lực của ngày có thể phụ thuộc vào tháng]
Khoảnh khắc không hợp lệNếu một khoảnh khắc không hợp lệ, nó sẽ hoạt động giống như một NaN trong các phép toán dấu phẩy động
Tất cả những điều sau đây tạo ra những khoảnh khắc không hợp lệ
780// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
781// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
782// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
783// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
784// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
785// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
786// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
787// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
788// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
789// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
790// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
791// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
Sau đây tạo ra một phiên bản địa phương hóa của
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
792
793 dẫn đến// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
794 ở địa phương hiện tại// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
795// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
796// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
797// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
798// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
799// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
900// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
901 [Trước 2. 18. 0]// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
902// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
Sự trở lại sau
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
903
904// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
905// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
906// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
907// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
908// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
909// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
910// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
911// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
912// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
913// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
914// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
915// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
916// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
917// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
918// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
919// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
920// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
Và những thứ này trả về
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
768 hoặc // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
922 với một số cấu trúc
923 trả về giá trị rỗng, như tất cả các getters có tên khác// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
924// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
925 có tất cả các giá trị được đặt thành// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
922// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
927 trả về một đối tượng Ngày không hợp lệ// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
928 trả về null// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
929 trả về null// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
930 trả về giá trị rỗng// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
901 trả về giá trị rỗng [Kể từ ngày 2. 18. 0]// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
Thêm 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
96Thay đổi khoảnh khắc ban đầu bằng cách thêm thời gian
Đây là một chức năng khá mạnh mẽ để thêm thời gian vào một thời điểm hiện tại. Để thêm thời gian, hãy nhập khóa thời gian bạn muốn thêm và số lượng bạn muốn thêm
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
97Cũng có một số phím tốc ký nếu bạn thích toàn bộ thứ ngắn gọn đó
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
98Chìa khóaViết tắtnămsyquýQthángMtuầnswdaysdhourshminutesmsecondssmillisecondsmsNếu bạn muốn thêm nhiều khóa khác nhau cùng một lúc, bạn có thể chuyển chúng vào dưới dạng đối tượng bằng chữ
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
99Không có giới hạn trên cho số tiền, vì vậy bạn có thể quá tải bất kỳ tham số nào
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
00Cân nhắc đặc biệt cho các tháng và năm
Nếu ngày trong tháng của ngày ban đầu lớn hơn số ngày trong tháng cuối cùng, thì ngày trong tháng sẽ thay đổi thành ngày cuối cùng trong tháng cuối cùng
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
01Ngoài ra còn có những cân nhắc đặc biệt cần lưu ý khi thêm thời gian vượt qua thời gian tiết kiệm ánh sáng ban ngày. Nếu bạn thêm năm, tháng, tuần hoặc ngày, thì giờ ban đầu sẽ luôn khớp với giờ đã thêm
Thêm một tháng sẽ thêm số tháng đã chỉ định vào ngày
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
02// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
03Nếu bạn đang thêm giờ, phút, giây hoặc mili giây, giả định là bạn muốn độ chính xác của giờ và sẽ dẫn đến một giờ khác
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
04Ngoài ra, bạn có thể sử dụng thời lượng để thêm vào khoảnh khắc
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
05Trước phiên bản 2. 8. 0, cú pháp
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
932 cũng được hỗ trợ. Nó không được dùng nữa để ủng hộ // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
933// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
06As of 2. 12. 0 when decimal values are passed for days and months, they are rounded to the nearest integer. Weeks, quarters, and years are converted to days or months, and then rounded to the nearest integer
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
07Start of Time 1. 7. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
08Mutates the original moment by setting it to the start of a unit of time
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
09Các phím tắt này về cơ bản giống như sau
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
10// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
11As of version 2. 0. 0,
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
934 đã thay thế // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
935Note.
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
936 was added in version 2. 0. 0Kể từ phiên bản 2. 1. 0,
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
936 uses the locale aware week start dayGhi chú.
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
938 was added in version 2. 2. 0Ghi chú.
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
939 đã được thêm làm bí danh cho ngày thứ 2. 13. 0UTC offset 2. 9. 0++
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
12Nhận hoặc đặt phần bù UTC sau vài phút
Ghi chú. Không giống như
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
940, hàm này trả về phần bù thực từ UTC, không phải phần bù ngược [như được trả về bởi // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
941]Lấy
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
942 của đối tượng hiện tại// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
13Đặt phần bù UTC bằng cách cung cấp số phút. Phần bù được đặt trên đối tượng thời điểm mà
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
943 được gọi trên. Nếu bạn muốn đặt phần bù trên toàn cầu, hãy thử sử dụng múi giờ. Lưu ý rằng khi bạn đặt giá trị bù, giá trị đó sẽ cố định và sẽ không tự thay đổi [i. e không có quy tắc DST]. Nếu bạn muốn múi giờ thực tế -- thời gian ở một địa điểm cụ thể, chẳng hạn như // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
944, hãy xem xét múi giờ-thời điểm// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
14Nếu đầu vào nhỏ hơn
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
945 và lớn hơn // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
946, thay vào đó, nó sẽ hiểu thông tin đầu vào của bạn là giờ// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
15Cũng có thể đặt độ lệch UTC từ một chuỗi
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
16// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
754 sẽ tìm kiếm chuỗi cho trận đấu cuối cùng của // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
948, do đó, bạn thậm chí có thể chuyển một chuỗi được định dạng ISO8601 với phần bù và thời điểm sẽ được thay đổi thành phần bù UTC đóLưu ý rằng nếu chuỗi không bao gồm 'Z', nó phải bao gồm ký tự
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
949 hoặc // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
950// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
17Hàm
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
942 có tham số thứ hai tùy chọn chấp nhận giá trị boolean cho biết có giữ thời gian hiện có trong ngày hay khôngVượt qua
903 [mặc định] sẽ giữ nguyên thời gian trong Giờ quốc tế, nhưng giờ địa phương sẽ thay đổi// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
Vượt qua
953 sẽ giữ nguyên giờ địa phương, nhưng phải trả giá bằng việc chọn một điểm khác trong Giờ quốc tế// only needing core define[['moment'], function [moment] { console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' }]; // core with single locale define[['moment', 'moment/locale/de'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // core with all locales define[['moment/min/moment-with-locales'], function [moment] { moment.locale['de']; console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }]; // async load locale define[['require', 'moment'], function[require, moment] { // Inside some module after the locale is detected. This is the // case where the locale is not known before module load time. require[['moment/locale/de'], function[localeModule] { // here the locale is loaded, but not yet in use console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM' moment.locale['de']; // Use moment now that the locale has been properly set. console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42' }] }];
Một cách sử dụng tính năng này là nếu bạn muốn xây dựng một khoảnh khắc với độ lệch múi giờ cụ thể chỉ bằng các giá trị đầu vào số
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
18Định dạng 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
19Đây là tùy chọn hiển thị mạnh mẽ nhất. Nó nhận một chuỗi mã thông báo và thay thế chúng bằng các giá trị tương ứng
____620TokenOutputMonthM1 2. 11 12Mùng 1 Mùng 2. ngày 11 ngày 12MM01 02. 11 12MMMJan Feb. Tháng 11 Tháng 12MMMMTháng 1 Tháng 2. Tháng 11 Tháng 12 Quý 1 Quý 2 3 Quý 4 Quý 2 Ngày 3 Ngày 4 Tháng 1 2. 30 31Do1thứ 2. 30 ngày 31DD01 02. 30 31 Ngày trong năm DD1 2. 364 365DDDo 1st 2nd. 364th 365thDDDD001 002 . 364 365Ngày trong tuần0 1. 5 6do0th 1. 5th 6ddSu Mo. Cha SadddChủ Nhật. Thứ Sáu SatddddChủ Nhật Thứ Hai. Thứ sáu Thứ bảyNgày trong tuần [Ngôn ngữ]e0 1. 5 6Ngày trong tuần [ISO]E1 2. 6 7Tuần trong nămw1 2. 52 53wo1thứ 2. thứ 52 thứ 53ww01 02. 52 53Tuần trong năm [ISO]W1 2. 52 53Wo1st 2nd. Thứ 52 Thứ 53WW01 02. 52 53NămYY70 71. 29 30YYYY1970 1971. 2029 2030YYYYYY-001970 -001971. +001907 +001971Lưu ý. Năm mở rộng [Bao gồm phạm vi giá trị toàn thời gian xấp xỉ 273.790 năm tiến hoặc lùi kể từ ngày 01 tháng 01 năm 1970]Y1970 1971. 9999 +10000 +10001
Lưu ý. Điều này tuân thủ tiêu chuẩn ISO 8601 cho các ngày sau năm 9999Era Yeary1 2. 2020. Kỷ nguyên, NN, NNNBC AD
Lưu ý. Tên thời đại AbbrNNNN Before Christ, Anno Domini
Ghi chú. Tên thời đại đầy đủNNNNNNBC AD
Ghi chú. Tên thời đại thu hẹpTuần Nămgg70 71. 29 30gggg1970 1971. 2029 2030Week Year [ISO]GG70 71 . 29 30GGGG1970 1971. 2029 2030AM/PMAAM PMMaam pmHourH0 1. 22 23HH00 01. 22 23h1 2. 11 12hh01 02. 11 12k1 2. 23 24kk01 02. 23 24Phút0 1. 58 59mm00 01. 58 59Giây0 1. 58 59ss00 01. 58 59Phân Số GiâyS0 1. 8 9SS00 01. 98 99SSS000 001. 998 999SSSS. SSSSSSSSS000[0. ] 001[0. ]. 998[0. ] 999[0. ] Múi giờ hoặc xe zEST. MST PST
Lưu ý. kể từ 1. 6. 0, mã thông báo định dạng z/zz không được dùng nữa từ các đối tượng thời điểm đơn giản. Đọc thêm về nó ở đây. Tuy nhiên, chúng *làm* hoạt động nếu bạn đang sử dụng một múi giờ cụ thể với addon múi giờ-thời điểm. Z-07. 00 -06. 00. +06. 00 +07. 00ZZ-0700 -0600. +0600 +0700Unix TimestampX1360013296Unix Millisecond Timestampx1360013296123
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
650 đã được thêm vào 2. 0. 0// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
955 đã được thêm vào 2. 1. 0// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
652 đã được thêm vào 2. 8. 4// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
715 đến // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
958 đã được thêm vào 2. 10. 5. Chúng hiển thị 3 chữ số có nghĩa và phần còn lại chứa đầy số không// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
959 và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
960 đã được thêm vào 2. 13. 0Định dạng bản địa hóa
Vì định dạng ưa thích khác nhau dựa trên ngôn ngữ, nên có một số mã thông báo có thể được sử dụng để định dạng một khoảnh khắc dựa trên ngôn ngữ của nó
Có các biến thể chữ hoa và chữ thường trên cùng một định dạng. Phiên bản chữ thường được dự định là phiên bản rút gọn của đối tác chữ hoa của nó
Thời gianLT8. 30 PM Thời gian tính bằng giây LTR8. 30. 25 giờ chiềuSố tháng, ngày tháng, nămL09/04/1986l9/4/1986Tên tháng, ngày tháng, nămLL 4/9/1986ll4/9/1986Tên tháng, ngày tháng, năm, giờLL 4/9/1986 8. 30 PMlllNgày 4 tháng 9 năm 1986 8. 30 giờ chiềuTên tháng, ngày trong tháng, ngày trong tuần, năm, giờLLLLThứ năm, ngày 4 tháng 9 năm 1986 8. 30 PMllllThu, ngày 4 tháng 9 năm 1986 8. 30 PM// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
961 are available in 2. 0. 0. // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
677 đã được thêm vào 2. 8. 4Nhân vật trốn thoát
Để thoát các ký tự trong chuỗi định dạng, bạn có thể đặt các ký tự trong dấu ngoặc vuông
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
21Điểm tương đồng và khác biệt với LDLML
Ghi chú. Mặc dù các định dạng ngày này rất giống với định dạng ngày của LDML, nhưng có một số khác biệt nhỏ liên quan đến ngày trong tháng, ngày trong năm và ngày trong tuần
Để biết bảng phân tích về một số mã thông báo định dạng ngày khác nhau trên các ngôn ngữ khác nhau, hãy xem biểu đồ mã thông báo định dạng ngày này
tốc độ định dạng
Để so sánh Khoảnh khắc. js so với các thư viện khác, hãy xem phần so sánh này với các thư viện khác
Các mã thông báo khác
Nếu bạn cảm thấy thoải mái hơn khi làm việc với strftime thay vì mã thông báo phân tích cú pháp giống như LDML, bạn có thể sử dụng plugin của Ben Oakes. benjaminoakes/khoảnh khắc
định dạng mặc định
Gọi
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
629 không có định dạng sẽ mặc định là // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
964. Ngoài hộp, ________ 5964 là định dạng ISO 8601 ________ 5966Kể từ phiên bản 2. 13. 0, khi ở chế độ UTC, định dạng mặc định được điều chỉnh bởi
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
967 có định dạng // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
968. Điều này trả về // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
626 làm phần bù, thay vì // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
970Trong một số trường hợp nhất định, múi giờ địa phương [chẳng hạn như
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
971] có thể có độ lệch bằng 0 và sẽ được coi là UTC. Trong những trường hợp như vậy, có thể hữu ích khi đặt // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
964 và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
967 để sử dụng cùng một định dạngThay đổi giá trị của
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
964 sẽ chỉ ảnh hưởng đến định dạng và sẽ không ảnh hưởng đến phân tích cú pháp. Ví dụ// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
22Thời gian tính từ bây giờ 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
23Một cách phổ biến để hiển thị thời gian được xử lý bởi
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
975. Điều này đôi khi được gọi là timeago hoặc thời gian tương đối// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
24Nếu bạn vượt qua
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
953, bạn có thể nhận được giá trị mà không cần hậu tố// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
25Các chuỗi cơ sở được tùy chỉnh theo ngôn ngữ hiện tại. Thời gian được làm tròn đến giây gần nhất
Bảng phân tích chuỗi nào được hiển thị trong mỗi khoảng thời gian được nêu trong bảng bên dưới
RangeKeySample Output0 đến 44 giâysa vài giây trướcunsetss44 giây trước45 đến 89 giâyma phút trước90 giây đến 44 phútmm2 phút trước. 44 phút trước45 đến 89 phútshan giờ trước90 phút đến 21 giờhh2 giờ trước. 21 giờ trước22 đến 35 giờda ngày trước36 giờ đến 25 ngàydd2 ngày trước. 25 ngày trước26 đến 45 ngàyMa tháng trước45 đến 319 ngàyMM2 tháng trước. 10 months ago320 to 547 days [1. 5 năm]một năm trước 548 ngày+yy2 năm trước. 20 năm trướcNote. From version 2. 10. 3, nếu đối tượng thời điểm đích không hợp lệ, kết quả là chuỗi ngày không hợp lệ được bản địa hóa
Note. Khóa
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
977 đã được thêm vào 2. 18. 0. Đó là một ngưỡng tùy chọn. Nó sẽ không bao giờ hiển thị TRỪ KHI người dùng đặt ngưỡng ss theo cách thủ công. Until the // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
977 threshold is set, it defaults to the value of the // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
979 threshold minus 1 [so, invisible to the user]Đến giờ 2. 10. 3+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
26A common way of displaying time is handled by
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
980. This is sometimes called timeago or relative timeThis is similar to
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
981, but gives the opposite interval. // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
982This is similar to
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
983, but is special-cased for the current time. Sử dụng // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
983, nếu bạn muốn kiểm soát hai điểm cuối của khoảng thời gian// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
27Nếu bạn vượt qua
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
953, bạn có thể nhận giá trị mà không cần tiền tố// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
28The base strings are customized by the current locale
Bảng phân tích chuỗi nào được hiển thị trong mỗi khoảng thời gian được nêu trong bảng bên dưới
RangeKeySample Output0 đến 44 giây trong giây45 đến 89 giâyphút một phút90 giây đến 44 phútmmin 2 phút. trong 44 phút45 đến 89 phút hin một giờ90 phút đến 21 giờ hin 2 giờ. in 21 hours22 to 35 hoursdin a day36 hours to 25 daysddin 2 days . trong 25 ngày26 đến 45 ngàyTối thiểu một tháng45 đến 319 ngàyMMTối thiểu 2 tháng. trong 10 tháng320 đến 547 ngày [1. 5 years]yin a year548 days+yyin 2 years . in 20 yearsFrom version 2. 10. 3, if the target moment object is invalid the result is the localized Invalid date string
Calendar Time 1. 3. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
29Calendar time displays time relative to a given
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
986 [defaults to the start of today], but does so slightly differently than // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
975// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
988 will format a date with different strings depending on how close to // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
986's date [today by default] the date isLast weekLast Monday at 2. 30 AMThe day beforeYesterday at 2. 30 AMThe same dayToday at 2. 30 AMThe next dayTomorrow at 2. 30 AMThe next weekSunday at 2. 30 AMEverything else7/10/2011These strings are localized, and can be customized
From 2. 10. 5 moment supports specifying calendar output formats per invocation
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
70// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
990 được sử dụng làm định dạng khi thời điểm cách // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
986 hơn một tuầnGhi chú. Từ phiên bản 2. 14. 0, đối số định dạng cho lịch có thể là lệnh gọi lại được thực thi trong ngữ cảnh thời điểm với một đối số duy nhất ngay bây giờ
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
71Ghi chú. Từ phiên bản 2. 25. 0, bạn chỉ có thể truyền đối số định dạng, nó có thể là đối tượng của chuỗi và hàm
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
72Sự khác biệt 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
73Để có sự khác biệt tính bằng mili giây, hãy sử dụng
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
992 giống như bạn sẽ sử dụng // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
993// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
74Để có được sự khác biệt trong một đơn vị đo lường khác, hãy chuyển phép đo đó làm đối số thứ hai
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
75To get the duration of a difference between two moments, you can pass
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
994 as an argument into // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
995. Xem tài liệu trên moment#duration để biết thêm thông tinCác phép đo được hỗ trợ là
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
996, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
997, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
998, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
999, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
000, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
001 và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
002. Để dễ phát triển, các dạng số ít được hỗ trợ kể từ 2. 0. 0. Các đơn vị đo lường khác với mili giây có sẵn trong phiên bản 1. 1. 1Theo mặc định,
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
992 sẽ cắt bớt kết quả đến 0 chữ số thập phân, trả về một số nguyên. Nếu bạn muốn một số dấu phẩy động, hãy chuyển // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
953 làm đối số thứ ba. trước 2. 0. 0, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
992 trả về một số được làm tròn thành số nguyên gần nhất, không phải số bị cắt bớt// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
76Nếu thời điểm này sớm hơn thời điểm bạn chuyển đến
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
006, giá trị trả về sẽ là số âm// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
77Một cách dễ dàng để nghĩ về điều này là thay thế
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
007 bằng một toán tử trừ// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
78Tháng và năm khác nhau
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
992 has some special handling for month and year diffs. It is optimized to ensure that two months with the same date are always a whole number apartVì vậy, ngày 15 tháng 1 đến ngày 15 tháng 2 phải đúng 1 tháng
28/02 đến 28/03 chắc là đúng 1 tháng
Ngày 28 tháng 2 năm 2011 đến ngày 28 tháng 2 năm 2012 phải đúng 1 năm
Xem thêm thảo luận về chênh lệch tháng và năm tại đây
Sự thay đổi khác biệt giữa tháng và năm này được thực hiện trong 2. 0. 0. Kể từ phiên bản 2. 9. 0 diff cũng hỗ trợ đơn vị quý
Is Before 2. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
79Check if a moment is before another moment. The first argument will be parsed as a moment, if not already so
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
00Nếu bạn muốn giới hạn mức độ chi tiết ở một đơn vị khác với mili giây, hãy chuyển các đơn vị làm tham số thứ hai
As the second parameter determines the precision, and not just a single value to check, using day will check for year, month and day
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
01Giống như
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
009 và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
010, bất kỳ đơn vị thời gian nào được hỗ trợ cho ________ 6011 đều được hỗ trợ cho ________ 6012// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
02Nếu không có gì được chuyển đến
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
012, nó sẽ mặc định là thời điểm hiện tạiGHI CHÚ.
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
014 có hành vi không xác định và không nên được sử dụng. If the code runs fast the initial created moment would be the same as the one created in isBefore to perform the check, so the result would be // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
903. Nhưng nếu mã chạy chậm hơn, có thể thời điểm được tạo trong is Before có thể đo được sau thời điểm được tạo trong // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
731, vì vậy lệnh gọi sẽ trả về // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
953Giống nhau 2. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
03Kiểm tra xem một khoảnh khắc có giống với một khoảnh khắc khác không. Đối số đầu tiên sẽ được phân tích cú pháp như một khoảnh khắc, nếu chưa
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
04Nếu bạn muốn giới hạn mức độ chi tiết ở một đơn vị khác với mili giây, hãy chuyển nó làm tham số thứ hai
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
05Khi bao gồm tham số thứ hai, nó sẽ khớp với tất cả các đơn vị bằng hoặc lớn hơn. Vượt qua _______ 6018 sẽ kiểm tra _______ 6018 và ________ 6020. Vượt qua
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
021 sẽ kiểm tra // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
021, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
018 và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
020// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
06Giống như
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
009 và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
012, bất kỳ đơn vị thời gian nào được hỗ trợ cho // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
011 đều được hỗ trợ cho // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
010// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
02Nếu hai thời điểm có múi giờ khác nhau thì múi giờ của thời điểm đầu tiên sẽ được dùng để so sánh
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
08GHI CHÚ.
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
029 có hành vi không xác định và không nên được sử dụng. Nếu mã chạy nhanh, thời điểm được tạo ban đầu sẽ giống với thời điểm được tạo trong isSame để thực hiện kiểm tra, vì vậy kết quả sẽ là // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
953. Nhưng nếu mã chạy chậm hơn thì có thể đo được thời điểm được tạo trong isSame sau thời điểm được tạo trong // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
731, do đó lệnh gọi sẽ trả về // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
903Nằm giữa 2. 9. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
09Kiểm tra xem một khoảnh khắc có nằm giữa hai khoảnh khắc khác hay không, tùy ý xem theo tỷ lệ đơn vị [phút, giờ, ngày, v.v.]. Trận đấu là độc quyền. Hai đối số đầu tiên sẽ được phân tích cú pháp dưới dạng khoảnh khắc, nếu chưa được như vậy
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
00Lưu ý rằng thứ tự của hai đối số quan trọng. ngày "nhỏ hơn" phải ở đối số đầu tiên
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
01Nếu bạn muốn giới hạn mức độ chi tiết ở một đơn vị khác với mili giây, hãy chuyển các đơn vị này làm tham số thứ ba
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
02Giống như
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
010, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
012, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
009 bất kỳ đơn vị thời gian nào được hỗ trợ cho // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
011 đều được hỗ trợ cho // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
037. Năm, tháng, tuần, isoWeek, ngày, giờ, phút và giâyPhiên bản 2. 13. 0 giới thiệu tính toàn diện. Một
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
038 cho biết bao gồm một giá trị. Một // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
039 biểu thị loại trừ. Nếu tham số bao gồm được sử dụng, cả hai chỉ số phải được thông qua// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
03Lưu ý rằng trong trường hợp các tham số
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
040 và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
041 giống nhau, nhưng các tham số bao gồm khác nhau, sai sẽ chiếm ưu thế// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
04Nếu tham số bao gồm không được chỉ định, Moment sẽ mặc định là
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
042Là Giờ mùa hè 1. 2. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
05// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
043 kiểm tra xem thời điểm hiện tại có phải là giờ mùa hè khôngGHI CHÚ. Chức năng này là một HACK. thời điểm không có cách nào để biết liệu một thời điểm nhất định có ở DST thực tế hay không. Một số thay đổi về thời gian trong một vùng có liên quan đến DST, một số thì không và không có thông tin múi giờ hoàn chỉnh thì không thể biết được
Khoảnh khắc hiện đang kiểm tra thời gian mùa đông và mùa hè, và nếu phần bù khớp với phần bù mùa hè [và thời gian nghỉ hè khác với thời gian nghỉ mùa đông], thì nó sẽ báo cáo DST. Điều này hoạt động trong phần lớn các trường hợp, nhưng như đã đề cập ở trên, không "chính xác" và sẽ không hoạt động trong mọi trường hợp. Vì vậy, đừng đến với chúng tôi phàn nàn
Múi giờ thời điểm sự kiện [tại thời điểm viết 0. 5. 37] không hỗ trợ thông tin DST [i. e có phải là đồng hồ chính thức trong DST tại một thời điểm nhất định hay không], vì vậy để mọi thứ trở nên tốt hơn, một số nội dung mới [và gói tzdata] phải diễn ra theo múi giờ
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
06Thay đổi ngôn ngữ trên toàn cầu 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
07Theo mặc định, Khoảnh khắc. js đi kèm với chuỗi ngôn ngữ tiếng Anh [Hoa Kỳ]. Nếu bạn cần các ngôn ngữ khác, bạn có thể tải chúng vào Khoảnh khắc. js for later use
To load a locale, pass the key and the string values to
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
044More details on each of the parts of the locale bundle can be found in the customization section
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
08Details about
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
045 and // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
046 can be found in the customization sectionOnce you load a locale, it becomes the active locale. Để thay đổi ngôn ngữ đang hoạt động, chỉ cần gọi
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
044 bằng khóa của ngôn ngữ đã tải// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
09kể từ 2. 21. 0, Khoảnh khắc sẽ
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
048 nếu ngôn ngữ không khả dụngkể từ 2. 8. 0, việc thay đổi ngôn ngữ chung không ảnh hưởng đến các phiên bản hiện có
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
10// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
044 trả về ngôn ngữ được sử dụng. Điều này hữu ích vì Khoảnh khắc sẽ không thay đổi ngôn ngữ nếu nó không biết ngôn ngữ bạn chỉ định// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
11Bạn cũng có thể chỉ định một danh sách các ngôn ngữ và Moment sẽ sử dụng danh sách đầu tiên mà nó có bản địa hóa cho
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
12Moment cũng sẽ thử các chuỗi con của trình xác định ngôn ngữ từ cụ thể nhất đến ít cụ thể nhất cho đến khi tìm thấy một ngôn ngữ mà nó biết. Điều này hữu ích khi cung cấp Khoảnh khắc bằng chuỗi ngôn ngữ được lấy từ môi trường của người dùng, chẳng hạn như
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
050// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
13Cuối cùng, Moment sẽ tìm kiếm một cách thông minh thông qua một loạt các ngôn ngữ và chuỗi con của chúng
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
14The logic works as follows -- the next locale is picked and tried as-is. If that fails, the code normally tries to chop the last bit [normally the country designation] and try again. Tuy nhiên, nếu phần tử mảng tiếp theo có tiền tố giống hoặc dài hơn phần tử được thử, thì quá trình lặp lại tiếp tục. Vì vậy, ví dụ nếu mảng có trình tự
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
15sau đó thử "AA-BB" đầu tiên, sau đó một giải pháp ngây thơ sẽ thử "AA", nhưng thay vào đó, giải pháp này sẽ kiểm tra xem "AA-CC" thực sự cụ thể hơn "AA", vì vậy, nó thử "AA-CC" . Vì vậy, cuối cùng, các ngôn ngữ sau được thử theo thứ tự này [giả sử tất cả đều không thành công nên ngôn ngữ tiếp theo sẽ được thử]
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
16Changing locales locally 1. 7. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
17Cấu hình ngôn ngữ chung có thể gặp sự cố khi chuyển qua các khoảnh khắc có thể cần được định dạng thành ngôn ngữ khác
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
18Nếu bạn gọi
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
051 mà không có tham số, bạn sẽ lấy lại cấu hình ngôn ngữ sẽ được sử dụng cho thời điểm đó// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
19Nếu bạn cần truy cập dữ liệu ngôn ngữ trong giây lát, đây là cách ưu tiên để làm như vậy
kể từ 2. 3. 0, bạn cũng có thể chỉ định một mảng các mã định danh ngôn ngữ. Nó hoạt động giống như trong cấu hình ngôn ngữ toàn cầu
Liệt kê các tháng và ngày trong tuần của Khoảnh khắc hiện tại. ngôn ngữ js 2. 3. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
20Đôi khi, rất hữu ích khi lấy danh sách các tháng hoặc ngày trong tuần ở một ngôn ngữ, chẳng hạn như khi điền vào menu thả xuống
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
21Trả về danh sách các tháng ở ngôn ngữ hiện tại
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
22Tương tự,
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
052 trả về tên tháng viết tắt và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
053, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
054, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
055 trả về danh sách các ngày trong tuầnBạn có thể chuyển một số nguyên vào từng hàm đó để biết tháng hoặc ngày trong tuần cụ thể
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
23As of 2. 13. 0, bạn có thể chuyển một bool làm tham số đầu tiên của các hàm ngày trong tuần. Nếu đúng, các ngày trong tuần sẽ được trả về theo thứ tự ngôn ngữ cụ thể. Chẳng hạn, trong tiếng Ả Rập, Thứ Bảy là ngày đầu tiên trong tuần, do đó
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
24Ghi chú. Không có tham số cụ thể của ngôn ngữ, các ngày trong tuần luôn có Chủ nhật là chỉ số 0, bất kể ngày đầu tuần của địa phương đó là gì
Một số địa phương đưa ra những cân nhắc đặc biệt khi định dạng tên tháng. For example, Dutch formats month abbreviations without a trailing period, but only if it's formatting the month between dashes. The
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
997 method supports passing a format in so that the months will be listed in the proper context// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
25And finally, you can combine both the format option and the integer option
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
26Accessing locale specific functionality 2. 8. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
27You can access the properties of the currently loaded locale through the
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
057 function. It returns the current locale or a locale with the given key// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
28The returned object has the following methods
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
29Thông tin chi tiết về
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
058 có thể được tìm thấy trong phần tùy chỉnhKhoảng khăc. js rất dễ tùy chỉnh. Nói chung, bạn nên tạo cài đặt ngôn ngữ với các tùy chỉnh của mình
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
30Bạn có thể xóa một ngôn ngữ đã xác định trước đó bằng cách chuyển
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
768 làm đối số thứ hai. Ngôn ngữ đã xóa sẽ không còn khả dụng để sử dụng// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
31kể từ 2. 12. 0, có thể tạo ngôn ngữ kế thừa từ ngôn ngữ gốc
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
32Properties that are not specified in the locale will be inherited from the parent locale
As of 2. 16. 0, có thể xác định ngôn ngữ có cha mẹ chưa được xác định hoặc tải
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
33As of 2. 21. 0 khi cố gắng tạo một khoảnh khắc với ngôn ngữ mới được xác định, khoảnh khắc sẽ cố tải cha mẹ xuống nếu nó tồn tại. Không thành công, nó sẽ mặc định cha mẹ thành ngôn ngữ toàn cầu
kể từ 2. 12. 0 cũng có thể cập nhật các thuộc tính của ngôn ngữ
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
34Any properties specified will be updated, while others will remain the same. This function does not affect moments that already exist. Lưu ý rằng việc gọi
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
060 cũng thay đổi ngôn ngữ toàn cầu hiện tại thành ngôn ngữ được cập nhật; Để hoàn nguyên một bản cập nhật, hãy sử dụng
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
352. 12. 0 deprecated using
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
643 to change an existing locale. Sử dụng // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
062 để thay thếTên tháng 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
36// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
063 should be an array of the month names// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
37Nếu bạn cần xử lý nhiều hơn để tính tên của tháng, [ví dụ: nếu có các ngữ pháp khác nhau cho các định dạng khác nhau], thì
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
063 có thể là một hàm có chữ ký sau. It should always return a month name// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
38Từ phiên bản 2. 11. 0 tháng cũng có thể là một đối tượng, chỉ định các hình thức
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
065 và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
066 [chỉ định và buộc tội]. Biểu thức chính quy được chạy trên định dạng để kiểm tra xem có sử dụng biểu mẫu // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
066 hay không là // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
068. Từ phiên bản 2. 14. 0 một số khác có thể được chỉ định bằng phím // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
069// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
39Tên ngày trong tuần 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
40// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
070 should be an array of the weekdays names// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
41// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
070 can be a callback function as well// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
42Note. Từ phiên bản 2. 11. 0 định dạng/trường hợp độc lập cũng có thể được thông qua.
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
069 sẽ được sử dụng đối với chuỗi định dạng đầy đủ để xác định nên sử dụng biểu mẫu nào// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
43Thời gian tương đối 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
44// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
073 phải là một đối tượng của chuỗi thay thế cho // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
993// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
45// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
075 đề cập đến tiền tố/hậu tố cho các ngày trong tương lai và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
076 đề cập đến tiền tố/hậu tố cho các ngày trong quá khứ. Đối với tất cả những người khác, một ký tự đơn đề cập đến số ít và một ký tự kép đề cập đến số nhiềuIf a locale requires additional processing for a token, it can set the token as a function with the following signature. Hàm sẽ trả về một chuỗi
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
46Đối số
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
077 đề cập đến khóa thay thế trong đối tượng // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
073. [ví dụ. // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
079, v.v. ]The
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
080 argument refers to the number of units for that key. For // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
081, the number is the number of minutes, etcĐối số
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
082 sẽ là đúng nếu mã thông báo sẽ được hiển thị mà không có hậu tố và sai nếu nó được hiển thị với hậu tố. [Lý do logic đảo ngược là vì hành vi mặc định là hiển thị với hậu tố. ]The
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
083 argument will be true if it is going to use the future suffix/prefix and false if it is going to use the past prefix/suffixGhi chú. Handling for
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
084 and // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
085 was added in 2. 25. 0Ngưỡng thời gian tương đối 2. 7. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
47// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
086 có các ngưỡng xác định thời điểm một đơn vị được coi là phút, giờ, v.v. Ví dụ: theo mặc định, hơn 45 giây được coi là một phút, hơn 22 giờ được coi là một ngày, v.v. Để thay đổi các giới hạn đó, hãy sử dụng // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
087 trong đó đơn vị là một trong số // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
977, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
979, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
081, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
091, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
092, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
084, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
094đơn vị nghĩa là số lần sử dụng là vài giây số giây nhỏ nhất được tính bằng giây, trừ 1. Phải được đặt sau khi đặt đơn vị `s` hoặc không đặt đơn vị `s`. ssecondsố giây ít nhất được coi là một phút. mminutes số phút ít nhất được coi là một giờ. hhoursleast number of hours to be considered a day. ddaysleast number of days to be considered a week. wweeksố tuần ít nhất được coi là một tháng. Không được sử dụng theo mặc định. Mtháng số tháng ít nhất được coi là một năm. // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
48Ghi chú. Đơn vị tuần đã được thêm vào trong 2. 25. 0. Theo mặc định, nó không được sử dụng [đặt thành null], nhưng bạn có thể đặt thành giá trị khác null và cũng [tùy chọn] đặt
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
092 thấp hơn, để nó chuyển từ vài ngày sang vài tuần trước đóGhi chú. Truy xuất ngưỡng đã được thêm vào trong 2. 8. 1
Ghi chú. Truy xuất và đặt ngưỡng
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
977 đã được thêm vào 2. 18. 0Ngày đầu tuần và tuần đầu tiên của năm 1. 0. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
49// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
097 phải là một số nguyên đại diện cho ngày đầu tiên của tuần, 0 là Chủ Nhật, 1 là Thứ Hai,. , 6 là thứ bảy// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
098 phải là một số nguyên. // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
099 được sử dụng cùng với // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
100 để xác định tuần đầu tiên của năm. // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
099 được tính là // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
102, trong đó // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
103 là ngày đầu tiên của tháng 1 phải thuộc tuần đầu tiên của năm// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
50Thời đại 2. 25. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
51Chỉ định thời đại cho một ngôn ngữ cụ thể. Một thời đại là một khoảng thời gian với tên và đánh số năm. Số năm tuyệt đối [như 2020] cũng có thể được chỉ định là 2020 AD. năm thứ 2020 của kỷ nguyên sau công nguyên. Tương tự, số năm tuyệt đối -0500 có thể được mô tả là 501 trước Công nguyên, năm thứ 501 kể từ thời đại trước Công nguyên
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
52// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
104 và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
105 chi phối hướng đi của thời đại. Như trong trường hợp của // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
106, nó phát triển về phía // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
107, do đó // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
104 > // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
105. Đối với các thời đại tăng dần về phía +Vô cực // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
104 < // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
105Phân tích cú pháp/định dạng thời đại được thực hiện bằng mã thông báo
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
112, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
113 và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
114Ghi chú. Các API liên quan đến thời đại có thể thay đổi
Đang tạo 1. 6. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
53Để tạo khoảng thời gian, hãy gọi
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
115 với khoảng thời gian tính bằng mili giây// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
54Nếu bạn muốn tạo khoảnh khắc với đơn vị đo khác mili giây, bạn có thể truyền đơn vị đo cũng được
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
55Cách viết tắt tương tự cho
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
116 và // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
117 cũng hoạt động ở đâyPhím Viết tắtnămsythángMtuầnswdaysdhourshminutesmsecondssmillisecondsmsGiống như
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
116, bạn có thể truyền một đối tượng giá trị nếu bạn cần nhiều đơn vị đo lường khác nhau// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
56kể từ 2. 1. 0, thời điểm hỗ trợ phân tích cú pháp ASP. NET phong cách khoảng thời gian. Các định dạng sau được hỗ trợ
Định dạng là một chuỗi giờ, phút, giây được phân tách bằng dấu hai chấm như
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
119. Số ngày có thể được bắt đầu bằng dấu phân cách dấu chấm như vậy // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
120. Một phần giây cũng được hỗ trợ // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
121// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
57kể từ 2. 3. 0, khoảnh khắc cũng hỗ trợ phân tích thời lượng ISO 8601
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
58kể từ 2. 11. 0, chuỗi định dạng thời lượng có khoảng cách giữa ngày và phần còn lại được hỗ trợ
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
59kể từ 2. 13. 0, các dấu hiệu âm và dương hỗn hợp được hỗ trợ khi phân tích thời lượng
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
60kể từ 2. 18. 0, thời lượng không hợp lệ được hỗ trợ, tương tự như thời điểm không hợp lệ. To create an invalid duration you can pass
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
922 for a value of a unitIn upcoming releases expect invalid durations to cover more cases [like null values for units]
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
61Nhân hóa 1. 6. 0+
edit// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
62Đôi khi, bạn muốn tất cả những điều tốt đẹp của
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
993 nhưng bạn không muốn phải tạo hai khoảnh khắc, bạn chỉ muốn hiển thị một khoảng thời gianEnter
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
124// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
63Theo mặc định, chuỗi trả về mô tả khoảng thời gian
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
125 [không có hậu tố]. Nếu bạn muốn thời lượng định hướng // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
126, // only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
127 [có hậu tố], hãy chuyển true như bên dưới// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
64Đối với các hậu tố trước đây, hãy chuyển vào một số âm
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
65Thời lượng không hợp lệ được nhân hóa thành phiên bản địa phương hóa của
// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
128// only needing core
define[['moment'], function [moment] {
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
}];
// core with single locale
define[['moment', 'moment/locale/de'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// core with all locales
define[['moment/min/moment-with-locales'], function [moment] {
moment.locale['de'];
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}];
// async load locale
define[['require', 'moment'], function[require, moment] {
// Inside some module after the locale is detected. This is the
// case where the locale is not known before module load time.
require[['moment/locale/de'], function[localeModule] {
// here the locale is loaded, but not yet in use
console.log[moment[].format['LLLL']]; // 'Friday, June 24, 2016 1:42 AM'
moment.locale['de'];
// Use moment now that the locale has been properly set.
console.log[moment[].format['LLLL']]; // 'Freitag, 24. Juni 2016 01:42'
}]
}];
66Đầu ra nhân hóa có thể được cấu hình với các ngưỡng thời gian tương đối. Để chỉ định các ngưỡng cho một lời gọi nhân hóa cụ thể, hãy chuyển chúng dưới dạng đối số duy nhất hoặc sau hậu tố arg