summaryrefslogtreecommitdiff
path: root/node_modules/moment/src/lib/locale/formats.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/moment/src/lib/locale/formats.js')
-rw-r--r--node_modules/moment/src/lib/locale/formats.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/node_modules/moment/src/lib/locale/formats.js b/node_modules/moment/src/lib/locale/formats.js
new file mode 100644
index 0000000..ea74837
--- /dev/null
+++ b/node_modules/moment/src/lib/locale/formats.js
@@ -0,0 +1,36 @@
+import { formattingTokens } from '../format/format';
+
+export var defaultLongDateFormat = {
+ LTS: 'h:mm:ss A',
+ LT: 'h:mm A',
+ L: 'MM/DD/YYYY',
+ LL: 'MMMM D, YYYY',
+ LLL: 'MMMM D, YYYY h:mm A',
+ LLLL: 'dddd, MMMM D, YYYY h:mm A',
+};
+
+export function longDateFormat(key) {
+ var format = this._longDateFormat[key],
+ formatUpper = this._longDateFormat[key.toUpperCase()];
+
+ if (format || !formatUpper) {
+ return format;
+ }
+
+ this._longDateFormat[key] = formatUpper
+ .match(formattingTokens)
+ .map(function (tok) {
+ if (
+ tok === 'MMMM' ||
+ tok === 'MM' ||
+ tok === 'DD' ||
+ tok === 'dddd'
+ ) {
+ return tok.slice(1);
+ }
+ return tok;
+ })
+ .join('');
+
+ return this._longDateFormat[key];
+}