├── .circleci └── config.yml ├── .gitignore ├── .npmignore ├── EXTEND.md ├── LICENSE ├── LOCALE.md ├── PLUGINS.md ├── README.md ├── benchmark └── bench.js ├── date-and-time.d.ts ├── date-and-time.js ├── date-and-time.min.js ├── esm ├── date-and-time.es.js ├── date-and-time.es.min.js ├── date-and-time.mjs ├── locale │ ├── ar.es.js │ ├── ar.mjs │ ├── az.es.js │ ├── az.mjs │ ├── bn.es.js │ ├── bn.mjs │ ├── cs.es.js │ ├── cs.mjs │ ├── de.es.js │ ├── de.mjs │ ├── dk.es.js │ ├── dk.mjs │ ├── el.es.js │ ├── el.mjs │ ├── en.es.js │ ├── en.mjs │ ├── es.es.js │ ├── es.mjs │ ├── fa.es.js │ ├── fa.mjs │ ├── fr.es.js │ ├── fr.mjs │ ├── hi.es.js │ ├── hi.mjs │ ├── hu.es.js │ ├── hu.mjs │ ├── id.es.js │ ├── id.mjs │ ├── it.es.js │ ├── it.mjs │ ├── ja.es.js │ ├── ja.mjs │ ├── jv.es.js │ ├── jv.mjs │ ├── ko.es.js │ ├── ko.mjs │ ├── my.es.js │ ├── my.mjs │ ├── nl.es.js │ ├── nl.mjs │ ├── pa-in.es.js │ ├── pa-in.mjs │ ├── pl.es.js │ ├── pl.mjs │ ├── pt.es.js │ ├── pt.mjs │ ├── ro.es.js │ ├── ro.mjs │ ├── ru.es.js │ ├── ru.mjs │ ├── rw.es.js │ ├── rw.mjs │ ├── sr.es.js │ ├── sr.mjs │ ├── sv.es.js │ ├── sv.mjs │ ├── th.es.js │ ├── th.mjs │ ├── tr.es.js │ ├── tr.mjs │ ├── uk.es.js │ ├── uk.mjs │ ├── uz.es.js │ ├── uz.mjs │ ├── vi.es.js │ ├── vi.mjs │ ├── zh-cn.es.js │ ├── zh-cn.mjs │ ├── zh-tw.es.js │ └── zh-tw.mjs └── plugin │ ├── day-of-week.es.js │ ├── day-of-week.mjs │ ├── meridiem.es.js │ ├── meridiem.mjs │ ├── microsecond.es.js │ ├── microsecond.mjs │ ├── ordinal.es.js │ ├── ordinal.mjs │ ├── timespan.es.js │ ├── timespan.mjs │ ├── timezone.es.js │ ├── timezone.mjs │ ├── two-digit-year.es.js │ └── two-digit-year.mjs ├── locale ├── ar.d.ts ├── ar.js ├── az.d.ts ├── az.js ├── bn.d.ts ├── bn.js ├── cs.d.ts ├── cs.js ├── de.d.ts ├── de.js ├── dk.d.ts ├── dk.js ├── el.d.ts ├── el.js ├── en.d.ts ├── en.js ├── es.d.ts ├── es.js ├── fa.d.ts ├── fa.js ├── fr.d.ts ├── fr.js ├── hi.d.ts ├── hi.js ├── hu.d.ts ├── hu.js ├── id.d.ts ├── id.js ├── it.d.ts ├── it.js ├── ja.d.ts ├── ja.js ├── jv.d.ts ├── jv.js ├── ko.d.ts ├── ko.js ├── my.d.ts ├── my.js ├── nl.d.ts ├── nl.js ├── pa-in.d.ts ├── pa-in.js ├── pl.d.ts ├── pl.js ├── pt.d.ts ├── pt.js ├── ro.d.ts ├── ro.js ├── ru.d.ts ├── ru.js ├── rw.d.ts ├── rw.js ├── sr.d.ts ├── sr.js ├── sv.d.ts ├── sv.js ├── th.d.ts ├── th.js ├── tr.d.ts ├── tr.js ├── uk.d.ts ├── uk.js ├── uz.d.ts ├── uz.js ├── vi.d.ts ├── vi.js ├── zh-cn.d.ts ├── zh-cn.js ├── zh-tw.d.ts └── zh-tw.js ├── package-lock.json ├── package.json ├── plugin ├── day-of-week.d.ts ├── day-of-week.js ├── meridiem.d.ts ├── meridiem.js ├── microsecond.d.ts ├── microsecond.js ├── ordinal.d.ts ├── ordinal.js ├── timespan.d.ts ├── timespan.js ├── timezone.d.ts ├── timezone.js ├── two-digit-year.d.ts └── two-digit-year.js ├── rollup.config.mjs ├── src ├── index.js ├── locale │ ├── ar.js │ ├── az.js │ ├── bn.js │ ├── cs.js │ ├── de.js │ ├── dk.js │ ├── el.js │ ├── en.js │ ├── es.js │ ├── fa.js │ ├── fr.js │ ├── hi.js │ ├── hu.js │ ├── id.js │ ├── it.js │ ├── ja.js │ ├── jv.js │ ├── ko.js │ ├── my.js │ ├── nl.js │ ├── pa-in.js │ ├── pl.js │ ├── pt.js │ ├── ro.js │ ├── ru.js │ ├── rw.js │ ├── sr.js │ ├── sv.js │ ├── th.js │ ├── tr.js │ ├── uk.js │ ├── uz.js │ ├── vi.js │ ├── zh-cn.js │ └── zh-tw.js └── plugin │ ├── day-of-week.js │ ├── meridiem.js │ ├── microsecond.js │ ├── ordinal.js │ ├── timespan.js │ ├── timezone.js │ └── two-digit-year.js ├── test.sh └── test ├── combination.js ├── dst.js ├── esm ├── combination.mjs ├── locale │ ├── ar.mjs │ ├── az.mjs │ ├── bn.mjs │ ├── cs.mjs │ ├── de.mjs │ ├── dk.mjs │ ├── el.mjs │ ├── es.mjs │ ├── fa.mjs │ ├── fr.mjs │ ├── hi.mjs │ ├── hu.mjs │ ├── id.mjs │ ├── it.mjs │ ├── ja.mjs │ ├── jv.mjs │ ├── ko.mjs │ ├── my.mjs │ ├── nl.mjs │ ├── pa-in.mjs │ ├── pl.mjs │ ├── pt.mjs │ ├── ro.mjs │ ├── ru.mjs │ ├── rw.mjs │ ├── sr.mjs │ ├── sv.mjs │ ├── th.mjs │ ├── tr.mjs │ ├── uk.mjs │ ├── uz.mjs │ ├── vi.mjs │ ├── zh-cn.mjs │ └── zh-tw.mjs └── plugin │ ├── day-of-week.mjs │ ├── meridiem.mjs │ ├── microsecond.mjs │ ├── ordinal.mjs │ ├── timespan.mjs │ ├── timezone.mjs │ └── two-digit-year.mjs ├── locale ├── ar.js ├── az.js ├── bn.js ├── cs.js ├── de.js ├── dk.js ├── el.js ├── es.js ├── fa.js ├── fr.js ├── hi.js ├── hu.js ├── id.js ├── it.js ├── ja.js ├── jv.js ├── ko.js ├── my.js ├── nl.js ├── pa-in.js ├── pl.js ├── pt.js ├── ro.js ├── ru.js ├── rw.js ├── sr.js ├── sv.js ├── th.js ├── tr.js ├── uk.js ├── uz.js ├── vi.js ├── zh-cn.js └── zh-tw.js ├── plugin ├── day-of-week.js ├── meridiem.js ├── microsecond.js ├── ordinal.js ├── timespan.js ├── timezone.js └── two-digit-year.js ├── test.js └── ts ├── date-and-time.d.ts ├── date-and-time.test-d.ts ├── locale ├── ar.d.ts ├── az.d.ts ├── bn.d.ts ├── cs.d.ts ├── de.d.ts ├── dk.d.ts ├── el.d.ts ├── en.d.ts ├── es.d.ts ├── fa.d.ts ├── fr.d.ts ├── hi.d.ts ├── hu.d.ts ├── id.d.ts ├── it.d.ts ├── ja.d.ts ├── jv.d.ts ├── ko.d.ts ├── my.d.ts ├── nl.d.ts ├── pa-in.d.ts ├── pl.d.ts ├── pt.d.ts ├── ro.d.ts ├── ru.d.ts ├── rw.d.ts ├── sr.d.ts ├── sv.d.ts ├── th.d.ts ├── tr.d.ts ├── uk.d.ts ├── uz.d.ts ├── vi.d.ts ├── zh-cn.d.ts └── zh-tw.d.ts └── plugin ├── day-of-week.d.ts ├── meridiem.d.ts ├── microsecond.d.ts ├── ordinal.d.ts ├── timespan.d.ts ├── timezone.d.ts └── two-digit-year.d.ts /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | 3 | jobs: 4 | build_and_test: 5 | docker: 6 | - image: cimg/node:current 7 | steps: 8 | - checkout 9 | - run: npm install 10 | - run: npm test 11 | 12 | workflows: 13 | build_and_test: 14 | jobs: 15 | - build_and_test 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .* 2 | benchmark 3 | rollup.config.mjs 4 | src 5 | test 6 | test.sh 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 KNOWLEDGECODE 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /benchmark/bench.js: -------------------------------------------------------------------------------- 1 | const date = require('../date-and-time'); 2 | const rand = (min, max) => ((Math.random() * (max - min) + min) | 0); 3 | const M = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; 4 | const A = ['a.m.', 'p.m.']; 5 | const dates = []; 6 | const dateString = []; 7 | const formatString = 'MMM. D YYYY h:m:s A'; 8 | const cnt = 3000000; 9 | 10 | console.log('Creating a list of random date string...'); 11 | 12 | for (let i = 0; i < cnt; i++) { 13 | const month = rand(0, 12); 14 | const day = '' + rand(1, 29); 15 | const year = '' + rand(2000, 2020); 16 | const hour = '' + rand(0, 12); 17 | const minute = '' + rand(0, 60); 18 | const sec = '' + rand(0, 60); 19 | const ampm = rand(0, 2); 20 | dates.push(new Date(year, month, day, hour + 12 * ampm, minute, sec)); 21 | dateString.push(`${M[month]}. ${day} ${year} ${hour}:${minute}:${sec} ${A[ampm]}`); 22 | } 23 | 24 | console.log('Starting the benchmark.\n'); 25 | 26 | let start = Date.now(); 27 | 28 | for (let i = 0; i < cnt; i++) { 29 | date.format(dates[i], formatString); 30 | } 31 | 32 | const bench1 = Date.now() - start; 33 | console.log(`format(): ${bench1}ms`); 34 | 35 | start = Date.now(); 36 | const pattern1 = date.compile(formatString); 37 | 38 | for (let i = 0; i < cnt; i++) { 39 | date.format(dates[i], pattern1); 40 | } 41 | 42 | const bench2 = Date.now() - start; 43 | console.log(`format() with compile(): ${bench2}ms (${Math.round(bench2 / bench1 * 100)}%)`); 44 | 45 | start = Date.now(); 46 | 47 | for (let i = 0; i < cnt; i++) { 48 | date.parse(dateString[i], formatString); 49 | } 50 | 51 | const bench3 = Date.now() - start; 52 | console.log(`parse(): ${bench3}ms`); 53 | 54 | start = Date.now(); 55 | const pattern2 = date.compile(formatString); 56 | 57 | for (let i = 0; i < cnt; i++) { 58 | date.parse(dateString[i], pattern2); 59 | } 60 | 61 | const bench4 = Date.now() - start; 62 | console.log(`parse() with compile(): ${bench4}ms (${Math.round(bench4 / bench3 * 100)}%)`); 63 | -------------------------------------------------------------------------------- /esm/locale/ar.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Arabic (ar) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ar = function (date) { 8 | var code = 'ar'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'], 13 | MMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'], 14 | dddd: ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 15 | ddd: ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], 16 | dd: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 17 | A: ['ص', 'م'] 18 | }, 19 | formatter: { 20 | post: function (str) { 21 | var num = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩']; 22 | return str.replace(/\d/g, function (i) { 23 | return num[i | 0]; 24 | }); 25 | } 26 | }, 27 | parser: { 28 | pre: function (str) { 29 | var map = { '٠': 0, '١': 1, '٢': 2, '٣': 3, '٤': 4, '٥': 5, '٦': 6, '٧': 7, '٨': 8, '٩': 9 }; 30 | return str.replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (i) { 31 | return '' + map[i]; 32 | }); 33 | } 34 | } 35 | }); 36 | return code; 37 | }; 38 | 39 | export { ar as default }; 40 | -------------------------------------------------------------------------------- /esm/locale/ar.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Arabic (ar) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ar = function (date) { 8 | var code = 'ar'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'], 13 | MMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'], 14 | dddd: ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 15 | ddd: ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], 16 | dd: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 17 | A: ['ص', 'م'] 18 | }, 19 | formatter: { 20 | post: function (str) { 21 | var num = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩']; 22 | return str.replace(/\d/g, function (i) { 23 | return num[i | 0]; 24 | }); 25 | } 26 | }, 27 | parser: { 28 | pre: function (str) { 29 | var map = { '٠': 0, '١': 1, '٢': 2, '٣': 3, '٤': 4, '٥': 5, '٦': 6, '٧': 7, '٨': 8, '٩': 9 }; 30 | return str.replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (i) { 31 | return '' + map[i]; 32 | }); 33 | } 34 | } 35 | }); 36 | return code; 37 | }; 38 | 39 | export { ar as default }; 40 | -------------------------------------------------------------------------------- /esm/locale/az.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Azerbaijani (az) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var az = function (date) { 8 | var code = 'az'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], 13 | MMM: ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'], 14 | dddd: ['Bazar', 'Bazar ertəsi', 'Çərşənbə axşamı', 'Çərşənbə', 'Cümə axşamı', 'Cümə', 'Şənbə'], 15 | ddd: ['Baz', 'BzE', 'ÇAx', 'Çər', 'CAx', 'Cüm', 'Şən'], 16 | dd: ['Bz', 'BE', 'ÇA', 'Çə', 'CA', 'Cü', 'Şə'], 17 | A: ['gecə', 'səhər', 'gündüz', 'axşam'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // gecə 24 | } else if (h < 12) { 25 | return this.res.A[1]; // səhər 26 | } else if (h < 17) { 27 | return this.res.A[2]; // gündüz 28 | } 29 | return this.res.A[3]; // axşam 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 2) { 35 | return h; // gecə, səhər 36 | } 37 | return h > 11 ? h : h + 12; // gündüz, axşam 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export { az as default }; 45 | -------------------------------------------------------------------------------- /esm/locale/az.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Azerbaijani (az) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var az = function (date) { 8 | var code = 'az'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], 13 | MMM: ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'], 14 | dddd: ['Bazar', 'Bazar ertəsi', 'Çərşənbə axşamı', 'Çərşənbə', 'Cümə axşamı', 'Cümə', 'Şənbə'], 15 | ddd: ['Baz', 'BzE', 'ÇAx', 'Çər', 'CAx', 'Cüm', 'Şən'], 16 | dd: ['Bz', 'BE', 'ÇA', 'Çə', 'CA', 'Cü', 'Şə'], 17 | A: ['gecə', 'səhər', 'gündüz', 'axşam'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // gecə 24 | } else if (h < 12) { 25 | return this.res.A[1]; // səhər 26 | } else if (h < 17) { 27 | return this.res.A[2]; // gündüz 28 | } 29 | return this.res.A[3]; // axşam 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 2) { 35 | return h; // gecə, səhər 36 | } 37 | return h > 11 ? h : h + 12; // gündüz, axşam 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export { az as default }; 45 | -------------------------------------------------------------------------------- /esm/locale/bn.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Bengali (bn) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var bn = function (date) { 8 | var code = 'bn'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['জানুয়ারী', 'ফেবুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'অগাস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], 13 | MMM: ['জানু', 'ফেব', 'মার্চ', 'এপর', 'মে', 'জুন', 'জুল', 'অগ', 'সেপ্ট', 'অক্টো', 'নভ', 'ডিসেম্'], 14 | dddd: ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পত্তিবার', 'শুক্রবার', 'শনিবার'], 15 | ddd: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পত্তি', 'শুক্র', 'শনি'], 16 | dd: ['রব', 'সম', 'মঙ্গ', 'বু', 'ব্রিহ', 'শু', 'শনি'], 17 | A: ['রাত', 'সকাল', 'দুপুর', 'বিকাল'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // রাত 24 | } else if (h < 10) { 25 | return this.res.A[1]; // সকাল 26 | } else if (h < 17) { 27 | return this.res.A[2]; // দুপুর 28 | } else if (h < 20) { 29 | return this.res.A[3]; // বিকাল 30 | } 31 | return this.res.A[0]; // রাত 32 | } 33 | }, 34 | parser: { 35 | h12: function (h, a) { 36 | if (a < 1) { 37 | return h < 4 || h > 11 ? h : h + 12; // রাত 38 | } else if (a < 2) { 39 | return h; // সকাল 40 | } else if (a < 3) { 41 | return h > 9 ? h : h + 12; // দুপুর 42 | } 43 | return h + 12; // বিকাল 44 | } 45 | } 46 | }); 47 | return code; 48 | }; 49 | 50 | export { bn as default }; 51 | -------------------------------------------------------------------------------- /esm/locale/bn.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Bengali (bn) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var bn = function (date) { 8 | var code = 'bn'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['জানুয়ারী', 'ফেবুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'অগাস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], 13 | MMM: ['জানু', 'ফেব', 'মার্চ', 'এপর', 'মে', 'জুন', 'জুল', 'অগ', 'সেপ্ট', 'অক্টো', 'নভ', 'ডিসেম্'], 14 | dddd: ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পত্তিবার', 'শুক্রবার', 'শনিবার'], 15 | ddd: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পত্তি', 'শুক্র', 'শনি'], 16 | dd: ['রব', 'সম', 'মঙ্গ', 'বু', 'ব্রিহ', 'শু', 'শনি'], 17 | A: ['রাত', 'সকাল', 'দুপুর', 'বিকাল'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // রাত 24 | } else if (h < 10) { 25 | return this.res.A[1]; // সকাল 26 | } else if (h < 17) { 27 | return this.res.A[2]; // দুপুর 28 | } else if (h < 20) { 29 | return this.res.A[3]; // বিকাল 30 | } 31 | return this.res.A[0]; // রাত 32 | } 33 | }, 34 | parser: { 35 | h12: function (h, a) { 36 | if (a < 1) { 37 | return h < 4 || h > 11 ? h : h + 12; // রাত 38 | } else if (a < 2) { 39 | return h; // সকাল 40 | } else if (a < 3) { 41 | return h > 9 ? h : h + 12; // দুপুর 42 | } 43 | return h + 12; // বিকাল 44 | } 45 | } 46 | }); 47 | return code; 48 | }; 49 | 50 | export { bn as default }; 51 | -------------------------------------------------------------------------------- /esm/locale/cs.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Czech (cs) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var cs = function (date) { 8 | var code = 'cs'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'], 13 | MMM: ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'], 14 | dddd: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], 15 | ddd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], 16 | dd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { cs as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/cs.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Czech (cs) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var cs = function (date) { 8 | var code = 'cs'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'], 13 | MMM: ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'], 14 | dddd: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], 15 | ddd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], 16 | dd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { cs as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/de.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve German (de) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var de = function (date) { 8 | var code = 'de'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 13 | MMM: ['Jan.', 'Febr.', 'Mrz.', 'Apr.', 'Mai', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'], 14 | dddd: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], 15 | ddd: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'], 16 | dd: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], 17 | A: ['Uhr nachmittags', 'Uhr morgens'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { de as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/de.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve German (de) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var de = function (date) { 8 | var code = 'de'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 13 | MMM: ['Jan.', 'Febr.', 'Mrz.', 'Apr.', 'Mai', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'], 14 | dddd: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], 15 | ddd: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'], 16 | dd: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], 17 | A: ['Uhr nachmittags', 'Uhr morgens'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { de as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/dk.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Danish (DK) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var dk = function (date) { 8 | var code = 'dk'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'], 13 | MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 14 | dddd: ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], 15 | ddd: ['søn', 'man', 'tir', 'ons', 'tors', 'fre', 'lør'], 16 | dd: ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { dk as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/dk.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Danish (DK) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var dk = function (date) { 8 | var code = 'dk'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'], 13 | MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 14 | dddd: ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], 15 | ddd: ['søn', 'man', 'tir', 'ons', 'tors', 'fre', 'lør'], 16 | dd: ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { dk as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/el.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Greek (el) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var el = function (date) { 8 | var code = 'el'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: [ 13 | ['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'], 14 | ['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου'] 15 | ], 16 | MMM: ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'], 17 | dddd: ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'], 18 | ddd: ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'], 19 | dd: ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'], 20 | A: ['πμ', 'μμ'] 21 | }, 22 | formatter: { 23 | MMMM: function (d, formatString) { 24 | return this.res.MMMM[/D.*MMMM/.test(formatString) | 0][d.getMonth()]; 25 | }, 26 | hh: function (d) { 27 | return ('0' + d.getHours() % 12).slice(-2); 28 | }, 29 | h: function (d) { 30 | return d.getHours() % 12; 31 | } 32 | }, 33 | parser: { 34 | MMMM: function (str, formatString) { 35 | var result = this.find(this.res.MMMM[/D.*MMMM/.test(formatString) | 0], str); 36 | result.value++; 37 | return result; 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export { el as default }; 45 | -------------------------------------------------------------------------------- /esm/locale/el.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Greek (el) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var el = function (date) { 8 | var code = 'el'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: [ 13 | ['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'], 14 | ['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου'] 15 | ], 16 | MMM: ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'], 17 | dddd: ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'], 18 | ddd: ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'], 19 | dd: ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'], 20 | A: ['πμ', 'μμ'] 21 | }, 22 | formatter: { 23 | MMMM: function (d, formatString) { 24 | return this.res.MMMM[/D.*MMMM/.test(formatString) | 0][d.getMonth()]; 25 | }, 26 | hh: function (d) { 27 | return ('0' + d.getHours() % 12).slice(-2); 28 | }, 29 | h: function (d) { 30 | return d.getHours() % 12; 31 | } 32 | }, 33 | parser: { 34 | MMMM: function (str, formatString) { 35 | var result = this.find(this.res.MMMM[/D.*MMMM/.test(formatString) | 0], str); 36 | result.value++; 37 | return result; 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export { el as default }; 45 | -------------------------------------------------------------------------------- /esm/locale/en.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Englis (en) 4 | * @preserve This is a dummy module. 5 | */ 6 | 7 | var en = function (date) { 8 | var code = 'en'; 9 | 10 | return code; 11 | }; 12 | 13 | export { en as default }; 14 | -------------------------------------------------------------------------------- /esm/locale/en.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Englis (en) 4 | * @preserve This is a dummy module. 5 | */ 6 | 7 | var en = function (date) { 8 | var code = 'en'; 9 | 10 | return code; 11 | }; 12 | 13 | export { en as default }; 14 | -------------------------------------------------------------------------------- /esm/locale/es.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Spanish (es) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var es = function (date) { 8 | var code = 'es'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], 13 | MMM: ['ene.', 'feb.', 'mar.', 'abr.', 'may.', 'jun.', 'jul.', 'ago.', 'sep.', 'oct.', 'nov.', 'dic.'], 14 | dddd: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'], 15 | ddd: ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'], 16 | dd: ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'], 17 | A: ['de la mañana', 'de la tarde', 'de la noche'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 12) { 23 | return this.res.A[0]; // de la mañana 24 | } else if (h < 19) { 25 | return this.res.A[1]; // de la tarde 26 | } 27 | return this.res.A[2]; // de la noche 28 | } 29 | }, 30 | parser: { 31 | h12: function (h, a) { 32 | if (a < 1) { 33 | return h; // de la mañana 34 | } 35 | return h > 11 ? h : h + 12; // de la tarde, de la noche 36 | } 37 | } 38 | }); 39 | return code; 40 | }; 41 | 42 | export { es as default }; 43 | -------------------------------------------------------------------------------- /esm/locale/es.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Spanish (es) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var es = function (date) { 8 | var code = 'es'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], 13 | MMM: ['ene.', 'feb.', 'mar.', 'abr.', 'may.', 'jun.', 'jul.', 'ago.', 'sep.', 'oct.', 'nov.', 'dic.'], 14 | dddd: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'], 15 | ddd: ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'], 16 | dd: ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'], 17 | A: ['de la mañana', 'de la tarde', 'de la noche'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 12) { 23 | return this.res.A[0]; // de la mañana 24 | } else if (h < 19) { 25 | return this.res.A[1]; // de la tarde 26 | } 27 | return this.res.A[2]; // de la noche 28 | } 29 | }, 30 | parser: { 31 | h12: function (h, a) { 32 | if (a < 1) { 33 | return h; // de la mañana 34 | } 35 | return h > 11 ? h : h + 12; // de la tarde, de la noche 36 | } 37 | } 38 | }); 39 | return code; 40 | }; 41 | 42 | export { es as default }; 43 | -------------------------------------------------------------------------------- /esm/locale/fa.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Persian (fa) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var fa = function (date) { 8 | var code = 'fa'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 13 | MMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 14 | dddd: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه'], 15 | ddd: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه'], 16 | dd: ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'], 17 | A: ['قبل از ظهر', 'بعد از ظهر'] 18 | }, 19 | formatter: { 20 | post: function (str) { 21 | var num = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']; 22 | return str.replace(/\d/g, function (i) { 23 | return num[i | 0]; 24 | }); 25 | } 26 | }, 27 | parser: { 28 | pre: function (str) { 29 | var map = { '۰': 0, '۱': 1, '۲': 2, '۳': 3, '۴': 4, '۵': 5, '۶': 6, '۷': 7, '۸': 8, '۹': 9 }; 30 | return str.replace(/[۰۱۲۳۴۵۶۷۸۹]/g, function (i) { 31 | return '' + map[i]; 32 | }); 33 | } 34 | } 35 | }); 36 | return code; 37 | }; 38 | 39 | export { fa as default }; 40 | -------------------------------------------------------------------------------- /esm/locale/fa.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Persian (fa) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var fa = function (date) { 8 | var code = 'fa'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 13 | MMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 14 | dddd: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه'], 15 | ddd: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه'], 16 | dd: ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'], 17 | A: ['قبل از ظهر', 'بعد از ظهر'] 18 | }, 19 | formatter: { 20 | post: function (str) { 21 | var num = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']; 22 | return str.replace(/\d/g, function (i) { 23 | return num[i | 0]; 24 | }); 25 | } 26 | }, 27 | parser: { 28 | pre: function (str) { 29 | var map = { '۰': 0, '۱': 1, '۲': 2, '۳': 3, '۴': 4, '۵': 5, '۶': 6, '۷': 7, '۸': 8, '۹': 9 }; 30 | return str.replace(/[۰۱۲۳۴۵۶۷۸۹]/g, function (i) { 31 | return '' + map[i]; 32 | }); 33 | } 34 | } 35 | }); 36 | return code; 37 | }; 38 | 39 | export { fa as default }; 40 | -------------------------------------------------------------------------------- /esm/locale/fr.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve French (fr) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var fr = function (date) { 8 | var code = 'fr'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], 13 | MMM: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], 14 | dddd: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], 15 | ddd: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], 16 | dd: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'], 17 | A: ['matin', 'l\'après-midi'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { fr as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/fr.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve French (fr) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var fr = function (date) { 8 | var code = 'fr'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], 13 | MMM: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], 14 | dddd: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], 15 | ddd: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], 16 | dd: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'], 17 | A: ['matin', 'l\'après-midi'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { fr as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/hi.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Hindi (hi) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var hi = function (date) { 8 | var code = 'hi'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 13 | MMM: ['जन.', 'फ़र.', 'मार्च', 'अप्रै.', 'मई', 'जून', 'जुल.', 'अग.', 'सित.', 'अक्टू.', 'नव.', 'दिस.'], 14 | dddd: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'], 15 | ddd: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरू', 'शुक्र', 'शनि'], 16 | dd: ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'], 17 | A: ['रात', 'सुबह', 'दोपहर', 'शाम'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // रात 24 | } else if (h < 10) { 25 | return this.res.A[1]; // सुबह 26 | } else if (h < 17) { 27 | return this.res.A[2]; // दोपहर 28 | } else if (h < 20) { 29 | return this.res.A[3]; // शाम 30 | } 31 | return this.res.A[0]; // रात 32 | } 33 | }, 34 | parser: { 35 | h12: function (h, a) { 36 | if (a < 1) { 37 | return h < 4 || h > 11 ? h : h + 12; // रात 38 | } else if (a < 2) { 39 | return h; // सुबह 40 | } else if (a < 3) { 41 | return h > 9 ? h : h + 12; // दोपहर 42 | } 43 | return h + 12; // शाम 44 | } 45 | } 46 | }); 47 | return code; 48 | }; 49 | 50 | export { hi as default }; 51 | -------------------------------------------------------------------------------- /esm/locale/hi.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Hindi (hi) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var hi = function (date) { 8 | var code = 'hi'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 13 | MMM: ['जन.', 'फ़र.', 'मार्च', 'अप्रै.', 'मई', 'जून', 'जुल.', 'अग.', 'सित.', 'अक्टू.', 'नव.', 'दिस.'], 14 | dddd: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'], 15 | ddd: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरू', 'शुक्र', 'शनि'], 16 | dd: ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'], 17 | A: ['रात', 'सुबह', 'दोपहर', 'शाम'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // रात 24 | } else if (h < 10) { 25 | return this.res.A[1]; // सुबह 26 | } else if (h < 17) { 27 | return this.res.A[2]; // दोपहर 28 | } else if (h < 20) { 29 | return this.res.A[3]; // शाम 30 | } 31 | return this.res.A[0]; // रात 32 | } 33 | }, 34 | parser: { 35 | h12: function (h, a) { 36 | if (a < 1) { 37 | return h < 4 || h > 11 ? h : h + 12; // रात 38 | } else if (a < 2) { 39 | return h; // सुबह 40 | } else if (a < 3) { 41 | return h > 9 ? h : h + 12; // दोपहर 42 | } 43 | return h + 12; // शाम 44 | } 45 | } 46 | }); 47 | return code; 48 | }; 49 | 50 | export { hi as default }; 51 | -------------------------------------------------------------------------------- /esm/locale/hu.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Hungarian (hu) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var hu = function (date) { 8 | var code = 'hu'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'], 13 | MMM: ['jan', 'feb', 'márc', 'ápr', 'máj', 'jún', 'júl', 'aug', 'szept', 'okt', 'nov', 'dec'], 14 | dddd: ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'], 15 | ddd: ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'], 16 | dd: ['v', 'h', 'k', 'sze', 'cs', 'p', 'szo'], 17 | A: ['de', 'du'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { hu as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/hu.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Hungarian (hu) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var hu = function (date) { 8 | var code = 'hu'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'], 13 | MMM: ['jan', 'feb', 'márc', 'ápr', 'máj', 'jún', 'júl', 'aug', 'szept', 'okt', 'nov', 'dec'], 14 | dddd: ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'], 15 | ddd: ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'], 16 | dd: ['v', 'h', 'k', 'sze', 'cs', 'p', 'szo'], 17 | A: ['de', 'du'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { hu as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/id.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Indonesian (id) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var id = function (date) { 8 | var code = 'id'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'], 13 | MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'], 14 | dddd: ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'], 15 | ddd: ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'], 16 | dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'], 17 | A: ['pagi', 'siang', 'sore', 'malam'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 11) { 23 | return this.res.A[0]; // pagi 24 | } else if (h < 15) { 25 | return this.res.A[1]; // siang 26 | } else if (h < 19) { 27 | return this.res.A[2]; // sore 28 | } 29 | return this.res.A[3]; // malam 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 1) { 35 | return h; // pagi 36 | } else if (a < 2) { 37 | return h >= 11 ? h : h + 12; // siang 38 | } 39 | return h + 12; // sore, malam 40 | } 41 | } 42 | }); 43 | return code; 44 | }; 45 | 46 | export { id as default }; 47 | -------------------------------------------------------------------------------- /esm/locale/id.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Indonesian (id) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var id = function (date) { 8 | var code = 'id'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'], 13 | MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'], 14 | dddd: ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'], 15 | ddd: ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'], 16 | dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'], 17 | A: ['pagi', 'siang', 'sore', 'malam'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 11) { 23 | return this.res.A[0]; // pagi 24 | } else if (h < 15) { 25 | return this.res.A[1]; // siang 26 | } else if (h < 19) { 27 | return this.res.A[2]; // sore 28 | } 29 | return this.res.A[3]; // malam 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 1) { 35 | return h; // pagi 36 | } else if (a < 2) { 37 | return h >= 11 ? h : h + 12; // siang 38 | } 39 | return h + 12; // sore, malam 40 | } 41 | } 42 | }); 43 | return code; 44 | }; 45 | 46 | export { id as default }; 47 | -------------------------------------------------------------------------------- /esm/locale/it.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Italian (it) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var it = function (date) { 8 | var code = 'it'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'], 13 | MMM: ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'], 14 | dddd: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], 15 | ddd: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'], 16 | dd: ['Do', 'Lu', 'Ma', 'Me', 'Gi', 'Ve', 'Sa'], 17 | A: ['di mattina', 'di pomerrigio'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { it as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/it.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Italian (it) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var it = function (date) { 8 | var code = 'it'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'], 13 | MMM: ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'], 14 | dddd: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], 15 | ddd: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'], 16 | dd: ['Do', 'Lu', 'Ma', 'Me', 'Gi', 'Ve', 'Sa'], 17 | A: ['di mattina', 'di pomerrigio'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { it as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/ja.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Japanese (ja) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ja = function (date) { 8 | var code = 'ja'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 13 | MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 14 | dddd: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'], 15 | ddd: ['日', '月', '火', '水', '木', '金', '土'], 16 | dd: ['日', '月', '火', '水', '木', '金', '土'], 17 | A: ['午前', '午後'] 18 | }, 19 | formatter: { 20 | hh: function (d) { 21 | return ('0' + d.getHours() % 12).slice(-2); 22 | }, 23 | h: function (d) { 24 | return d.getHours() % 12; 25 | } 26 | } 27 | }); 28 | return code; 29 | }; 30 | 31 | export { ja as default }; 32 | -------------------------------------------------------------------------------- /esm/locale/ja.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Japanese (ja) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ja = function (date) { 8 | var code = 'ja'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 13 | MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 14 | dddd: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'], 15 | ddd: ['日', '月', '火', '水', '木', '金', '土'], 16 | dd: ['日', '月', '火', '水', '木', '金', '土'], 17 | A: ['午前', '午後'] 18 | }, 19 | formatter: { 20 | hh: function (d) { 21 | return ('0' + d.getHours() % 12).slice(-2); 22 | }, 23 | h: function (d) { 24 | return d.getHours() % 12; 25 | } 26 | } 27 | }); 28 | return code; 29 | }; 30 | 31 | export { ja as default }; 32 | -------------------------------------------------------------------------------- /esm/locale/jv.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Javanese (jv) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var jv = function (date) { 8 | var code = 'jv'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'], 13 | MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nop', 'Des'], 14 | dddd: ['Minggu', 'Senen', 'Seloso', 'Rebu', 'Kemis', 'Jemuwah', 'Septu'], 15 | ddd: ['Min', 'Sen', 'Sel', 'Reb', 'Kem', 'Jem', 'Sep'], 16 | dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sp'], 17 | A: ['enjing', 'siyang', 'sonten', 'ndalu'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 11) { 23 | return this.res.A[0]; // enjing 24 | } else if (h < 15) { 25 | return this.res.A[1]; // siyang 26 | } else if (h < 19) { 27 | return this.res.A[2]; // sonten 28 | } 29 | return this.res.A[3]; // ndalu 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 1) { 35 | return h; // enjing 36 | } else if (a < 2) { 37 | return h >= 11 ? h : h + 12; // siyang 38 | } 39 | return h + 12; // sonten, ndalu 40 | } 41 | } 42 | }); 43 | return code; 44 | }; 45 | 46 | export { jv as default }; 47 | -------------------------------------------------------------------------------- /esm/locale/jv.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Javanese (jv) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var jv = function (date) { 8 | var code = 'jv'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'], 13 | MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nop', 'Des'], 14 | dddd: ['Minggu', 'Senen', 'Seloso', 'Rebu', 'Kemis', 'Jemuwah', 'Septu'], 15 | ddd: ['Min', 'Sen', 'Sel', 'Reb', 'Kem', 'Jem', 'Sep'], 16 | dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sp'], 17 | A: ['enjing', 'siyang', 'sonten', 'ndalu'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 11) { 23 | return this.res.A[0]; // enjing 24 | } else if (h < 15) { 25 | return this.res.A[1]; // siyang 26 | } else if (h < 19) { 27 | return this.res.A[2]; // sonten 28 | } 29 | return this.res.A[3]; // ndalu 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 1) { 35 | return h; // enjing 36 | } else if (a < 2) { 37 | return h >= 11 ? h : h + 12; // siyang 38 | } 39 | return h + 12; // sonten, ndalu 40 | } 41 | } 42 | }); 43 | return code; 44 | }; 45 | 46 | export { jv as default }; 47 | -------------------------------------------------------------------------------- /esm/locale/ko.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Korean (ko) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ko = function (date) { 8 | var code = 'ko'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 13 | MMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 14 | dddd: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'], 15 | ddd: ['일', '월', '화', '수', '목', '금', '토'], 16 | dd: ['일', '월', '화', '수', '목', '금', '토'], 17 | A: ['오전', '오후'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { ko as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/ko.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Korean (ko) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ko = function (date) { 8 | var code = 'ko'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 13 | MMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 14 | dddd: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'], 15 | ddd: ['일', '월', '화', '수', '목', '금', '토'], 16 | dd: ['일', '월', '화', '수', '목', '금', '토'], 17 | A: ['오전', '오후'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { ko as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/my.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Burmese (my) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var my = function (date) { 8 | var code = 'my'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'သြဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'], 13 | MMM: ['ဇန်', 'ဖေ', 'မတ်', 'ပြီ', 'မေ', 'ဇွန်', 'လိုင်', 'သြ', 'စက်', 'အောက်', 'နို', 'ဒီ'], 14 | dddd: ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'], 15 | ddd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], 16 | dd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'] 17 | }, 18 | formatter: { 19 | post: function (str) { 20 | var num = ['၀', '၁', '၂', '၃', '၄', '၅', '၆', '၇', '၈', '၉']; 21 | return str.replace(/\d/g, function (i) { 22 | return num[i | 0]; 23 | }); 24 | } 25 | }, 26 | parser: { 27 | pre: function (str) { 28 | var map = { '၀': 0, '၁': 1, '၂': 2, '၃': 3, '၄': 4, '၅': 5, '၆': 6, '၇': 7, '၈': 8, '၉': 9 }; 29 | return str.replace(/[၀၁၂၃၄၅၆၇၈၉]/g, function (i) { 30 | return '' + map[i]; 31 | }); 32 | } 33 | } 34 | }); 35 | return code; 36 | }; 37 | 38 | export { my as default }; 39 | -------------------------------------------------------------------------------- /esm/locale/my.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Burmese (my) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var my = function (date) { 8 | var code = 'my'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'သြဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'], 13 | MMM: ['ဇန်', 'ဖေ', 'မတ်', 'ပြီ', 'မေ', 'ဇွန်', 'လိုင်', 'သြ', 'စက်', 'အောက်', 'နို', 'ဒီ'], 14 | dddd: ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'], 15 | ddd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], 16 | dd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'] 17 | }, 18 | formatter: { 19 | post: function (str) { 20 | var num = ['၀', '၁', '၂', '၃', '၄', '၅', '၆', '၇', '၈', '၉']; 21 | return str.replace(/\d/g, function (i) { 22 | return num[i | 0]; 23 | }); 24 | } 25 | }, 26 | parser: { 27 | pre: function (str) { 28 | var map = { '၀': 0, '၁': 1, '၂': 2, '၃': 3, '၄': 4, '၅': 5, '၆': 6, '၇': 7, '၈': 8, '၉': 9 }; 29 | return str.replace(/[၀၁၂၃၄၅၆၇၈၉]/g, function (i) { 30 | return '' + map[i]; 31 | }); 32 | } 33 | } 34 | }); 35 | return code; 36 | }; 37 | 38 | export { my as default }; 39 | -------------------------------------------------------------------------------- /esm/locale/nl.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Dutch (nl) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var nl = function (date) { 8 | var code = 'nl'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], 13 | MMM: [ 14 | ['jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'], 15 | ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'] 16 | ], 17 | dddd: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], 18 | ddd: ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'], 19 | dd: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za'] 20 | }, 21 | formatter: { 22 | MMM: function (d, formatString) { 23 | return this.res.MMM[/-MMM-/.test(formatString) | 0][d.getMonth()]; 24 | } 25 | }, 26 | parser: { 27 | MMM: function (str, formatString) { 28 | var result = this.find(this.res.MMM[/-MMM-/.test(formatString) | 0], str); 29 | result.value++; 30 | return result; 31 | } 32 | } 33 | }); 34 | return code; 35 | }; 36 | 37 | export { nl as default }; 38 | -------------------------------------------------------------------------------- /esm/locale/nl.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Dutch (nl) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var nl = function (date) { 8 | var code = 'nl'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], 13 | MMM: [ 14 | ['jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'], 15 | ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'] 16 | ], 17 | dddd: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], 18 | ddd: ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'], 19 | dd: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za'] 20 | }, 21 | formatter: { 22 | MMM: function (d, formatString) { 23 | return this.res.MMM[/-MMM-/.test(formatString) | 0][d.getMonth()]; 24 | } 25 | }, 26 | parser: { 27 | MMM: function (str, formatString) { 28 | var result = this.find(this.res.MMM[/-MMM-/.test(formatString) | 0], str); 29 | result.value++; 30 | return result; 31 | } 32 | } 33 | }); 34 | return code; 35 | }; 36 | 37 | export { nl as default }; 38 | -------------------------------------------------------------------------------- /esm/locale/pl.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Polish (pl) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var pl = function (date) { 8 | var code = 'pl'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: [ 13 | ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'], 14 | ['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia'] 15 | ], 16 | MMM: ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'], 17 | dddd: ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'], 18 | ddd: ['nie', 'pon', 'wt', 'śr', 'czw', 'pt', 'sb'], 19 | dd: ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'] 20 | }, 21 | formatter: { 22 | MMMM: function (d, formatString) { 23 | return this.res.MMMM[/D MMMM/.test(formatString) | 0][d.getMonth()]; 24 | } 25 | }, 26 | parser: { 27 | MMMM: function (str, formatString) { 28 | var result = this.find(this.res.MMMM[/D MMMM/.test(formatString) | 0], str); 29 | result.value++; 30 | return result; 31 | } 32 | } 33 | }); 34 | return code; 35 | }; 36 | 37 | export { pl as default }; 38 | -------------------------------------------------------------------------------- /esm/locale/pl.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Polish (pl) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var pl = function (date) { 8 | var code = 'pl'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: [ 13 | ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'], 14 | ['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia'] 15 | ], 16 | MMM: ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'], 17 | dddd: ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'], 18 | ddd: ['nie', 'pon', 'wt', 'śr', 'czw', 'pt', 'sb'], 19 | dd: ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'] 20 | }, 21 | formatter: { 22 | MMMM: function (d, formatString) { 23 | return this.res.MMMM[/D MMMM/.test(formatString) | 0][d.getMonth()]; 24 | } 25 | }, 26 | parser: { 27 | MMMM: function (str, formatString) { 28 | var result = this.find(this.res.MMMM[/D MMMM/.test(formatString) | 0], str); 29 | result.value++; 30 | return result; 31 | } 32 | } 33 | }); 34 | return code; 35 | }; 36 | 37 | export { pl as default }; 38 | -------------------------------------------------------------------------------- /esm/locale/pt.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Portuguese (pt) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var pt = function (date) { 8 | var code = 'pt'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'], 13 | MMM: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'], 14 | dddd: ['Domingo', 'Segunda-Feira', 'Terça-Feira', 'Quarta-Feira', 'Quinta-Feira', 'Sexta-Feira', 'Sábado'], 15 | ddd: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'], 16 | dd: ['Dom', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sáb'], 17 | A: ['da madrugada', 'da manhã', 'da tarde', 'da noite'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 5) { 23 | return this.res.A[0]; // da madrugada 24 | } else if (h < 12) { 25 | return this.res.A[1]; // da manhã 26 | } else if (h < 19) { 27 | return this.res.A[2]; // da tarde 28 | } 29 | return this.res.A[3]; // da noite 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 2) { 35 | return h; // da madrugada, da manhã 36 | } 37 | return h > 11 ? h : h + 12; // da tarde, da noite 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export { pt as default }; 45 | -------------------------------------------------------------------------------- /esm/locale/pt.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Portuguese (pt) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var pt = function (date) { 8 | var code = 'pt'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'], 13 | MMM: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'], 14 | dddd: ['Domingo', 'Segunda-Feira', 'Terça-Feira', 'Quarta-Feira', 'Quinta-Feira', 'Sexta-Feira', 'Sábado'], 15 | ddd: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'], 16 | dd: ['Dom', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sáb'], 17 | A: ['da madrugada', 'da manhã', 'da tarde', 'da noite'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 5) { 23 | return this.res.A[0]; // da madrugada 24 | } else if (h < 12) { 25 | return this.res.A[1]; // da manhã 26 | } else if (h < 19) { 27 | return this.res.A[2]; // da tarde 28 | } 29 | return this.res.A[3]; // da noite 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 2) { 35 | return h; // da madrugada, da manhã 36 | } 37 | return h > 11 ? h : h + 12; // da tarde, da noite 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export { pt as default }; 45 | -------------------------------------------------------------------------------- /esm/locale/ro.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Romanian (ro) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ro = function (date) { 8 | var code = 'ro'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'], 13 | MMM: ['ian.', 'febr.', 'mart.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.'], 14 | dddd: ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'], 15 | ddd: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'], 16 | dd: ['Du', 'Lu', 'Ma', 'Mi', 'Jo', 'Vi', 'Sâ'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { ro as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/ro.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Romanian (ro) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ro = function (date) { 8 | var code = 'ro'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'], 13 | MMM: ['ian.', 'febr.', 'mart.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.'], 14 | dddd: ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'], 15 | ddd: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'], 16 | dd: ['Du', 'Lu', 'Ma', 'Mi', 'Jo', 'Vi', 'Sâ'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { ro as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/ru.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Russian (ru) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ru = function (date) { 8 | var code = 'ru'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Января', 'Февраля', 'Марта', 'Апреля', 'Мая', 'Июня', 'Июля', 'Августа', 'Сентября', 'Октября', 'Ноября', 'Декабря'], 13 | MMM: ['янв', 'фев', 'мар', 'апр', 'мая', 'июня', 'июля', 'авг', 'сен', 'окт', 'ноя', 'дек'], 14 | dddd: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'], 15 | ddd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], 16 | dd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], 17 | A: ['ночи', 'утра', 'дня', 'вечера'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // ночи 24 | } else if (h < 12) { 25 | return this.res.A[1]; // утра 26 | } else if (h < 17) { 27 | return this.res.A[2]; // дня 28 | } 29 | return this.res.A[3]; // вечера 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 2) { 35 | return h; // ночи, утра 36 | } 37 | return h > 11 ? h : h + 12; // дня, вечера 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export { ru as default }; 45 | -------------------------------------------------------------------------------- /esm/locale/ru.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Russian (ru) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ru = function (date) { 8 | var code = 'ru'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Января', 'Февраля', 'Марта', 'Апреля', 'Мая', 'Июня', 'Июля', 'Августа', 'Сентября', 'Октября', 'Ноября', 'Декабря'], 13 | MMM: ['янв', 'фев', 'мар', 'апр', 'мая', 'июня', 'июля', 'авг', 'сен', 'окт', 'ноя', 'дек'], 14 | dddd: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'], 15 | ddd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], 16 | dd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], 17 | A: ['ночи', 'утра', 'дня', 'вечера'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // ночи 24 | } else if (h < 12) { 25 | return this.res.A[1]; // утра 26 | } else if (h < 17) { 27 | return this.res.A[2]; // дня 28 | } 29 | return this.res.A[3]; // вечера 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 2) { 35 | return h; // ночи, утра 36 | } 37 | return h > 11 ? h : h + 12; // дня, вечера 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export { ru as default }; 45 | -------------------------------------------------------------------------------- /esm/locale/rw.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Kinyarwanda (rw) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var rw = function (date) { 8 | var code = 'rw'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Mutarama', 'Gashyantare', 'Werurwe', 'Mata', 'Gicurasi', 'Kamena', 'Nyakanga', 'Kanama', 'Nzeri', 'Ukwakira', 'Ugushyingo', 'Ukuboza'], 13 | MMM: ['Mtr', 'Gas', 'Wer', 'Mta', 'Gic', 'Kmn', 'Nyk', 'Knm', 'Nze', 'Ukw', 'Ugu', 'Uku'], 14 | dddd: ['Ku cyumweru', 'Ku wambere', 'Ku wakabiri', 'Ku wagatatu', 'Ku wakane', 'Ku wagatanu', 'Ku wagatandatu'], 15 | ddd: ['Cyu', 'Mbe', 'Kbr', 'Gtt', 'Kne', 'Gtn', 'Gtd'], 16 | dd: ['Cy', 'Mb', 'Kb', 'Gt', 'Kn', 'Gn', 'Gd'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { rw as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/rw.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Kinyarwanda (rw) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var rw = function (date) { 8 | var code = 'rw'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Mutarama', 'Gashyantare', 'Werurwe', 'Mata', 'Gicurasi', 'Kamena', 'Nyakanga', 'Kanama', 'Nzeri', 'Ukwakira', 'Ugushyingo', 'Ukuboza'], 13 | MMM: ['Mtr', 'Gas', 'Wer', 'Mta', 'Gic', 'Kmn', 'Nyk', 'Knm', 'Nze', 'Ukw', 'Ugu', 'Uku'], 14 | dddd: ['Ku cyumweru', 'Ku wambere', 'Ku wakabiri', 'Ku wagatatu', 'Ku wakane', 'Ku wagatanu', 'Ku wagatandatu'], 15 | ddd: ['Cyu', 'Mbe', 'Kbr', 'Gtt', 'Kne', 'Gtn', 'Gtd'], 16 | dd: ['Cy', 'Mb', 'Kb', 'Gt', 'Kn', 'Gn', 'Gd'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { rw as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/sr.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Serbian (sr) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var sr = function (date) { 8 | var code = 'sr'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], 13 | MMM: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], 14 | dddd: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], 15 | ddd: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], 16 | dd: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { sr as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/sr.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Serbian (sr) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var sr = function (date) { 8 | var code = 'sr'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], 13 | MMM: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], 14 | dddd: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], 15 | ddd: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], 16 | dd: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { sr as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/sv.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Swedish (SV) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var sv = function (date) { 8 | var code = 'sv'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'], 13 | MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 14 | dddd: ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'], 15 | ddd: ['sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör'], 16 | dd: ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { sv as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/sv.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Swedish (SV) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var sv = function (date) { 8 | var code = 'sv'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'], 13 | MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 14 | dddd: ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'], 15 | ddd: ['sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör'], 16 | dd: ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { sv as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/th.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Thai (th) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var th = function (date) { 8 | var code = 'th'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'], 13 | MMM: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'], 14 | dddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'], 15 | ddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'], 16 | dd: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], 17 | A: ['ก่อนเที่ยง', 'หลังเที่ยง'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { th as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/th.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Thai (th) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var th = function (date) { 8 | var code = 'th'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'], 13 | MMM: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'], 14 | dddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'], 15 | ddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'], 16 | dd: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], 17 | A: ['ก่อนเที่ยง', 'หลังเที่ยง'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { th as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/tr.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Turkish (tr) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var tr = function (date) { 8 | var code = 'tr'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'], 13 | MMM: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'], 14 | dddd: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'], 15 | ddd: ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'], 16 | dd: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { tr as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/tr.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Turkish (tr) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var tr = function (date) { 8 | var code = 'tr'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'], 13 | MMM: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'], 14 | dddd: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'], 15 | ddd: ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'], 16 | dd: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { tr as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/uz.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Uzbek (uz) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var uz = function (date) { 8 | var code = 'uz'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'], 13 | MMM: ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], 14 | dddd: ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'], 15 | ddd: ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], 16 | dd: ['Як', 'Ду', 'Се', 'Чо', 'Па', 'Жу', 'Ша'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { uz as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/uz.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Uzbek (uz) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var uz = function (date) { 8 | var code = 'uz'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'], 13 | MMM: ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], 14 | dddd: ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'], 15 | ddd: ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], 16 | dd: ['Як', 'Ду', 'Се', 'Чо', 'Па', 'Жу', 'Ша'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export { uz as default }; 23 | -------------------------------------------------------------------------------- /esm/locale/vi.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Vietnamese (vi) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var vi = function (date) { 8 | var code = 'vi'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12'], 13 | MMM: ['Th01', 'Th02', 'Th03', 'Th04', 'Th05', 'Th06', 'Th07', 'Th08', 'Th09', 'Th10', 'Th11', 'Th12'], 14 | dddd: ['chủ nhật', 'thứ hai', 'thứ ba', 'thứ tư', 'thứ năm', 'thứ sáu', 'thứ bảy'], 15 | ddd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], 16 | dd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], 17 | A: ['sa', 'ch'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { vi as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/vi.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Vietnamese (vi) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var vi = function (date) { 8 | var code = 'vi'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12'], 13 | MMM: ['Th01', 'Th02', 'Th03', 'Th04', 'Th05', 'Th06', 'Th07', 'Th08', 'Th09', 'Th10', 'Th11', 'Th12'], 14 | dddd: ['chủ nhật', 'thứ hai', 'thứ ba', 'thứ tư', 'thứ năm', 'thứ sáu', 'thứ bảy'], 15 | ddd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], 16 | dd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], 17 | A: ['sa', 'ch'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export { vi as default }; 24 | -------------------------------------------------------------------------------- /esm/locale/zh-cn.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Chinese (zh-cn) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var zh_cn = function (date) { 8 | var code = 'zh-cn'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 13 | MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 14 | dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 15 | ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], 16 | dd: ['日', '一', '二', '三', '四', '五', '六'], 17 | A: ['凌晨', '早上', '上午', '中午', '下午', '晚上'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var hm = d.getHours() * 100 + d.getMinutes(); 22 | if (hm < 600) { 23 | return this.res.A[0]; // 凌晨 24 | } else if (hm < 900) { 25 | return this.res.A[1]; // 早上 26 | } else if (hm < 1130) { 27 | return this.res.A[2]; // 上午 28 | } else if (hm < 1230) { 29 | return this.res.A[3]; // 中午 30 | } else if (hm < 1800) { 31 | return this.res.A[4]; // 下午 32 | } 33 | return this.res.A[5]; // 晚上 34 | } 35 | }, 36 | parser: { 37 | h12: function (h, a) { 38 | if (a < 4) { 39 | return h; // 凌晨, 早上, 上午, 中午 40 | } 41 | return h > 11 ? h : h + 12; // 下午, 晚上 42 | } 43 | } 44 | }); 45 | return code; 46 | }; 47 | 48 | export { zh_cn as default }; 49 | -------------------------------------------------------------------------------- /esm/locale/zh-cn.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Chinese (zh-cn) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var zh_cn = function (date) { 8 | var code = 'zh-cn'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 13 | MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 14 | dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 15 | ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], 16 | dd: ['日', '一', '二', '三', '四', '五', '六'], 17 | A: ['凌晨', '早上', '上午', '中午', '下午', '晚上'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var hm = d.getHours() * 100 + d.getMinutes(); 22 | if (hm < 600) { 23 | return this.res.A[0]; // 凌晨 24 | } else if (hm < 900) { 25 | return this.res.A[1]; // 早上 26 | } else if (hm < 1130) { 27 | return this.res.A[2]; // 上午 28 | } else if (hm < 1230) { 29 | return this.res.A[3]; // 中午 30 | } else if (hm < 1800) { 31 | return this.res.A[4]; // 下午 32 | } 33 | return this.res.A[5]; // 晚上 34 | } 35 | }, 36 | parser: { 37 | h12: function (h, a) { 38 | if (a < 4) { 39 | return h; // 凌晨, 早上, 上午, 中午 40 | } 41 | return h > 11 ? h : h + 12; // 下午, 晚上 42 | } 43 | } 44 | }); 45 | return code; 46 | }; 47 | 48 | export { zh_cn as default }; 49 | -------------------------------------------------------------------------------- /esm/locale/zh-tw.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Chinese (zh-tw) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var zh_tw = function (date) { 8 | var code = 'zh-tw'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 13 | MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 14 | dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 15 | ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], 16 | dd: ['日', '一', '二', '三', '四', '五', '六'], 17 | A: ['早上', '上午', '中午', '下午', '晚上'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var hm = d.getHours() * 100 + d.getMinutes(); 22 | if (hm < 900) { 23 | return this.res.A[0]; // 早上 24 | } else if (hm < 1130) { 25 | return this.res.A[1]; // 上午 26 | } else if (hm < 1230) { 27 | return this.res.A[2]; // 中午 28 | } else if (hm < 1800) { 29 | return this.res.A[3]; // 下午 30 | } 31 | return this.res.A[4]; // 晚上 32 | } 33 | }, 34 | parser: { 35 | h12: function (h, a) { 36 | if (a < 3) { 37 | return h; // 早上, 上午, 中午 38 | } 39 | return h > 11 ? h : h + 12; // 下午, 晚上 40 | } 41 | } 42 | }); 43 | return code; 44 | }; 45 | 46 | export { zh_tw as default }; 47 | -------------------------------------------------------------------------------- /esm/locale/zh-tw.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Chinese (zh-tw) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var zh_tw = function (date) { 8 | var code = 'zh-tw'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 13 | MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 14 | dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 15 | ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], 16 | dd: ['日', '一', '二', '三', '四', '五', '六'], 17 | A: ['早上', '上午', '中午', '下午', '晚上'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var hm = d.getHours() * 100 + d.getMinutes(); 22 | if (hm < 900) { 23 | return this.res.A[0]; // 早上 24 | } else if (hm < 1130) { 25 | return this.res.A[1]; // 上午 26 | } else if (hm < 1230) { 27 | return this.res.A[2]; // 中午 28 | } else if (hm < 1800) { 29 | return this.res.A[3]; // 下午 30 | } 31 | return this.res.A[4]; // 晚上 32 | } 33 | }, 34 | parser: { 35 | h12: function (h, a) { 36 | if (a < 3) { 37 | return h; // 早上, 上午, 中午 38 | } 39 | return h > 11 ? h : h + 12; // 下午, 晚上 40 | } 41 | } 42 | }); 43 | return code; 44 | }; 45 | 46 | export { zh_tw as default }; 47 | -------------------------------------------------------------------------------- /esm/plugin/day-of-week.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve day-of-week 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'day-of-week'; 8 | 9 | date.plugin(name, { 10 | parser: { 11 | dddd: function (str) { return this.find(this.res.dddd, str); }, 12 | ddd: function (str) { return this.find(this.res.ddd, str); }, 13 | dd: function (str) { return this.find(this.res.dd, str); } 14 | } 15 | }); 16 | return name; 17 | }; 18 | 19 | export { plugin as default }; 20 | -------------------------------------------------------------------------------- /esm/plugin/day-of-week.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve day-of-week 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'day-of-week'; 8 | 9 | date.plugin(name, { 10 | parser: { 11 | dddd: function (str) { return this.find(this.res.dddd, str); }, 12 | ddd: function (str) { return this.find(this.res.ddd, str); }, 13 | dd: function (str) { return this.find(this.res.dd, str); } 14 | } 15 | }); 16 | return name; 17 | }; 18 | 19 | export { plugin as default }; 20 | -------------------------------------------------------------------------------- /esm/plugin/meridiem.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve meridiem 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'meridiem'; 8 | 9 | date.plugin(name, { 10 | res: { 11 | AA: ['A.M.', 'P.M.'], 12 | a: ['am', 'pm'], 13 | aa: ['a.m.', 'p.m.'] 14 | }, 15 | formatter: { 16 | AA: function (d) { 17 | return this.res.AA[d.getHours() > 11 | 0]; 18 | }, 19 | a: function (d) { 20 | return this.res.a[d.getHours() > 11 | 0]; 21 | }, 22 | aa: function (d) { 23 | return this.res.aa[d.getHours() > 11 | 0]; 24 | } 25 | }, 26 | parser: { 27 | AA: function (str) { 28 | var result = this.find(this.res.AA, str); 29 | result.token = 'A'; 30 | return result; 31 | }, 32 | a: function (str) { 33 | var result = this.find(this.res.a, str); 34 | result.token = 'A'; 35 | return result; 36 | }, 37 | aa: function (str) { 38 | var result = this.find(this.res.aa, str); 39 | result.token = 'A'; 40 | return result; 41 | } 42 | } 43 | }); 44 | return name; 45 | }; 46 | 47 | export { plugin as default }; 48 | -------------------------------------------------------------------------------- /esm/plugin/meridiem.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve meridiem 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'meridiem'; 8 | 9 | date.plugin(name, { 10 | res: { 11 | AA: ['A.M.', 'P.M.'], 12 | a: ['am', 'pm'], 13 | aa: ['a.m.', 'p.m.'] 14 | }, 15 | formatter: { 16 | AA: function (d) { 17 | return this.res.AA[d.getHours() > 11 | 0]; 18 | }, 19 | a: function (d) { 20 | return this.res.a[d.getHours() > 11 | 0]; 21 | }, 22 | aa: function (d) { 23 | return this.res.aa[d.getHours() > 11 | 0]; 24 | } 25 | }, 26 | parser: { 27 | AA: function (str) { 28 | var result = this.find(this.res.AA, str); 29 | result.token = 'A'; 30 | return result; 31 | }, 32 | a: function (str) { 33 | var result = this.find(this.res.a, str); 34 | result.token = 'A'; 35 | return result; 36 | }, 37 | aa: function (str) { 38 | var result = this.find(this.res.aa, str); 39 | result.token = 'A'; 40 | return result; 41 | } 42 | } 43 | }); 44 | return name; 45 | }; 46 | 47 | export { plugin as default }; 48 | -------------------------------------------------------------------------------- /esm/plugin/microsecond.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve microsecond 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'microsecond'; 8 | 9 | date.plugin(name, { 10 | parser: { 11 | SSSSSS: function (str) { 12 | var result = this.exec(/^\d{1,6}/, str); 13 | result.value = result.value / 1000 | 0; 14 | return result; 15 | }, 16 | SSSSS: function (str) { 17 | var result = this.exec(/^\d{1,5}/, str); 18 | result.value = result.value / 100 | 0; 19 | return result; 20 | }, 21 | SSSS: function (str) { 22 | var result = this.exec(/^\d{1,4}/, str); 23 | result.value = result.value / 10 | 0; 24 | return result; 25 | } 26 | } 27 | }); 28 | return name; 29 | }; 30 | 31 | export { plugin as default }; 32 | -------------------------------------------------------------------------------- /esm/plugin/microsecond.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve microsecond 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'microsecond'; 8 | 9 | date.plugin(name, { 10 | parser: { 11 | SSSSSS: function (str) { 12 | var result = this.exec(/^\d{1,6}/, str); 13 | result.value = result.value / 1000 | 0; 14 | return result; 15 | }, 16 | SSSSS: function (str) { 17 | var result = this.exec(/^\d{1,5}/, str); 18 | result.value = result.value / 100 | 0; 19 | return result; 20 | }, 21 | SSSS: function (str) { 22 | var result = this.exec(/^\d{1,4}/, str); 23 | result.value = result.value / 10 | 0; 24 | return result; 25 | } 26 | } 27 | }); 28 | return name; 29 | }; 30 | 31 | export { plugin as default }; 32 | -------------------------------------------------------------------------------- /esm/plugin/ordinal.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve ordinal 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'ordinal'; 8 | 9 | date.plugin(name, { 10 | formatter: { 11 | DDD: function (d) { 12 | var day = d.getDate(); 13 | 14 | switch (day) { 15 | case 1: 16 | case 21: 17 | case 31: 18 | return day + 'st'; 19 | case 2: 20 | case 22: 21 | return day + 'nd'; 22 | case 3: 23 | case 23: 24 | return day + 'rd'; 25 | default: 26 | return day + 'th'; 27 | } 28 | } 29 | } 30 | }); 31 | return name; 32 | }; 33 | 34 | export { plugin as default }; 35 | -------------------------------------------------------------------------------- /esm/plugin/ordinal.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve ordinal 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'ordinal'; 8 | 9 | date.plugin(name, { 10 | formatter: { 11 | DDD: function (d) { 12 | var day = d.getDate(); 13 | 14 | switch (day) { 15 | case 1: 16 | case 21: 17 | case 31: 18 | return day + 'st'; 19 | case 2: 20 | case 22: 21 | return day + 'nd'; 22 | case 3: 23 | case 23: 24 | return day + 'rd'; 25 | default: 26 | return day + 'th'; 27 | } 28 | } 29 | } 30 | }); 31 | return name; 32 | }; 33 | 34 | export { plugin as default }; 35 | -------------------------------------------------------------------------------- /esm/plugin/two-digit-year.es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve two-digit-year 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'two-digit-year'; 8 | 9 | date.plugin(name, { 10 | parser: { 11 | YY: function (str) { 12 | var result = this.exec(/^\d\d/, str); 13 | result.value += result.value < 70 ? 2000 : 1900; 14 | return result; 15 | } 16 | } 17 | }); 18 | return name; 19 | }; 20 | 21 | export { plugin as default }; 22 | -------------------------------------------------------------------------------- /esm/plugin/two-digit-year.mjs: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve two-digit-year 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'two-digit-year'; 8 | 9 | date.plugin(name, { 10 | parser: { 11 | YY: function (str) { 12 | var result = this.exec(/^\d\d/, str); 13 | result.value += result.value < 70 ? 2000 : 1900; 14 | return result; 15 | } 16 | } 17 | }); 18 | return name; 19 | }; 20 | 21 | export { plugin as default }; 22 | -------------------------------------------------------------------------------- /locale/ar.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/az.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/bn.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/cs.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/cs.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.cs = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Czech (cs) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var cs = function (date) { 14 | var code = 'cs'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'], 19 | MMM: ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'], 20 | dddd: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], 21 | ddd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], 22 | dd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'] 23 | } 24 | }); 25 | return code; 26 | }; 27 | 28 | return cs; 29 | 30 | })); 31 | -------------------------------------------------------------------------------- /locale/de.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/de.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.de = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve German (de) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var de = function (date) { 14 | var code = 'de'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 19 | MMM: ['Jan.', 'Febr.', 'Mrz.', 'Apr.', 'Mai', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'], 20 | dddd: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], 21 | ddd: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'], 22 | dd: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], 23 | A: ['Uhr nachmittags', 'Uhr morgens'] 24 | } 25 | }); 26 | return code; 27 | }; 28 | 29 | return de; 30 | 31 | })); 32 | -------------------------------------------------------------------------------- /locale/dk.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/dk.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.dk = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Danish (DK) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var dk = function (date) { 14 | var code = 'dk'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'], 19 | MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 20 | dddd: ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], 21 | ddd: ['søn', 'man', 'tir', 'ons', 'tors', 'fre', 'lør'], 22 | dd: ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'] 23 | } 24 | }); 25 | return code; 26 | }; 27 | 28 | return dk; 29 | 30 | })); 31 | -------------------------------------------------------------------------------- /locale/el.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/en.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/en.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.en = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Englis (en) 10 | * @preserve This is a dummy module. 11 | */ 12 | 13 | var en = function (date) { 14 | var code = 'en'; 15 | 16 | return code; 17 | }; 18 | 19 | return en; 20 | 21 | })); 22 | -------------------------------------------------------------------------------- /locale/es.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/es.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.es = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Spanish (es) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var es = function (date) { 14 | var code = 'es'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], 19 | MMM: ['ene.', 'feb.', 'mar.', 'abr.', 'may.', 'jun.', 'jul.', 'ago.', 'sep.', 'oct.', 'nov.', 'dic.'], 20 | dddd: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'], 21 | ddd: ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'], 22 | dd: ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'], 23 | A: ['de la mañana', 'de la tarde', 'de la noche'] 24 | }, 25 | formatter: { 26 | A: function (d) { 27 | var h = d.getHours(); 28 | if (h < 12) { 29 | return this.res.A[0]; // de la mañana 30 | } else if (h < 19) { 31 | return this.res.A[1]; // de la tarde 32 | } 33 | return this.res.A[2]; // de la noche 34 | } 35 | }, 36 | parser: { 37 | h12: function (h, a) { 38 | if (a < 1) { 39 | return h; // de la mañana 40 | } 41 | return h > 11 ? h : h + 12; // de la tarde, de la noche 42 | } 43 | } 44 | }); 45 | return code; 46 | }; 47 | 48 | return es; 49 | 50 | })); 51 | -------------------------------------------------------------------------------- /locale/fa.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/fa.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.fa = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Persian (fa) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var fa = function (date) { 14 | var code = 'fa'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 19 | MMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 20 | dddd: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه'], 21 | ddd: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه'], 22 | dd: ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'], 23 | A: ['قبل از ظهر', 'بعد از ظهر'] 24 | }, 25 | formatter: { 26 | post: function (str) { 27 | var num = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']; 28 | return str.replace(/\d/g, function (i) { 29 | return num[i | 0]; 30 | }); 31 | } 32 | }, 33 | parser: { 34 | pre: function (str) { 35 | var map = { '۰': 0, '۱': 1, '۲': 2, '۳': 3, '۴': 4, '۵': 5, '۶': 6, '۷': 7, '۸': 8, '۹': 9 }; 36 | return str.replace(/[۰۱۲۳۴۵۶۷۸۹]/g, function (i) { 37 | return '' + map[i]; 38 | }); 39 | } 40 | } 41 | }); 42 | return code; 43 | }; 44 | 45 | return fa; 46 | 47 | })); 48 | -------------------------------------------------------------------------------- /locale/fr.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/fr.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.fr = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve French (fr) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var fr = function (date) { 14 | var code = 'fr'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], 19 | MMM: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], 20 | dddd: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], 21 | ddd: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], 22 | dd: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'], 23 | A: ['matin', 'l\'après-midi'] 24 | } 25 | }); 26 | return code; 27 | }; 28 | 29 | return fr; 30 | 31 | })); 32 | -------------------------------------------------------------------------------- /locale/hi.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/hu.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/hu.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.hu = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Hungarian (hu) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var hu = function (date) { 14 | var code = 'hu'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'], 19 | MMM: ['jan', 'feb', 'márc', 'ápr', 'máj', 'jún', 'júl', 'aug', 'szept', 'okt', 'nov', 'dec'], 20 | dddd: ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'], 21 | ddd: ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'], 22 | dd: ['v', 'h', 'k', 'sze', 'cs', 'p', 'szo'], 23 | A: ['de', 'du'] 24 | } 25 | }); 26 | return code; 27 | }; 28 | 29 | return hu; 30 | 31 | })); 32 | -------------------------------------------------------------------------------- /locale/id.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/it.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/it.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.it = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Italian (it) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var it = function (date) { 14 | var code = 'it'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'], 19 | MMM: ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'], 20 | dddd: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], 21 | ddd: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'], 22 | dd: ['Do', 'Lu', 'Ma', 'Me', 'Gi', 'Ve', 'Sa'], 23 | A: ['di mattina', 'di pomerrigio'] 24 | } 25 | }); 26 | return code; 27 | }; 28 | 29 | return it; 30 | 31 | })); 32 | -------------------------------------------------------------------------------- /locale/ja.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/ja.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.ja = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Japanese (ja) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var ja = function (date) { 14 | var code = 'ja'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 19 | MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 20 | dddd: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'], 21 | ddd: ['日', '月', '火', '水', '木', '金', '土'], 22 | dd: ['日', '月', '火', '水', '木', '金', '土'], 23 | A: ['午前', '午後'] 24 | }, 25 | formatter: { 26 | hh: function (d) { 27 | return ('0' + d.getHours() % 12).slice(-2); 28 | }, 29 | h: function (d) { 30 | return d.getHours() % 12; 31 | } 32 | } 33 | }); 34 | return code; 35 | }; 36 | 37 | return ja; 38 | 39 | })); 40 | -------------------------------------------------------------------------------- /locale/jv.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/ko.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/ko.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.ko = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Korean (ko) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var ko = function (date) { 14 | var code = 'ko'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 19 | MMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 20 | dddd: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'], 21 | ddd: ['일', '월', '화', '수', '목', '금', '토'], 22 | dd: ['일', '월', '화', '수', '목', '금', '토'], 23 | A: ['오전', '오후'] 24 | } 25 | }); 26 | return code; 27 | }; 28 | 29 | return ko; 30 | 31 | })); 32 | -------------------------------------------------------------------------------- /locale/my.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/my.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.my = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Burmese (my) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var my = function (date) { 14 | var code = 'my'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'သြဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'], 19 | MMM: ['ဇန်', 'ဖေ', 'မတ်', 'ပြီ', 'မေ', 'ဇွန်', 'လိုင်', 'သြ', 'စက်', 'အောက်', 'နို', 'ဒီ'], 20 | dddd: ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'], 21 | ddd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], 22 | dd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'] 23 | }, 24 | formatter: { 25 | post: function (str) { 26 | var num = ['၀', '၁', '၂', '၃', '၄', '၅', '၆', '၇', '၈', '၉']; 27 | return str.replace(/\d/g, function (i) { 28 | return num[i | 0]; 29 | }); 30 | } 31 | }, 32 | parser: { 33 | pre: function (str) { 34 | var map = { '၀': 0, '၁': 1, '၂': 2, '၃': 3, '၄': 4, '၅': 5, '၆': 6, '၇': 7, '၈': 8, '၉': 9 }; 35 | return str.replace(/[၀၁၂၃၄၅၆၇၈၉]/g, function (i) { 36 | return '' + map[i]; 37 | }); 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | return my; 45 | 46 | })); 47 | -------------------------------------------------------------------------------- /locale/nl.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/nl.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.nl = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Dutch (nl) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var nl = function (date) { 14 | var code = 'nl'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], 19 | MMM: [ 20 | ['jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'], 21 | ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'] 22 | ], 23 | dddd: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], 24 | ddd: ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'], 25 | dd: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za'] 26 | }, 27 | formatter: { 28 | MMM: function (d, formatString) { 29 | return this.res.MMM[/-MMM-/.test(formatString) | 0][d.getMonth()]; 30 | } 31 | }, 32 | parser: { 33 | MMM: function (str, formatString) { 34 | var result = this.find(this.res.MMM[/-MMM-/.test(formatString) | 0], str); 35 | result.value++; 36 | return result; 37 | } 38 | } 39 | }); 40 | return code; 41 | }; 42 | 43 | return nl; 44 | 45 | })); 46 | -------------------------------------------------------------------------------- /locale/pa-in.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/pl.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/pl.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.pl = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Polish (pl) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var pl = function (date) { 14 | var code = 'pl'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: [ 19 | ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'], 20 | ['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia'] 21 | ], 22 | MMM: ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'], 23 | dddd: ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'], 24 | ddd: ['nie', 'pon', 'wt', 'śr', 'czw', 'pt', 'sb'], 25 | dd: ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'] 26 | }, 27 | formatter: { 28 | MMMM: function (d, formatString) { 29 | return this.res.MMMM[/D MMMM/.test(formatString) | 0][d.getMonth()]; 30 | } 31 | }, 32 | parser: { 33 | MMMM: function (str, formatString) { 34 | var result = this.find(this.res.MMMM[/D MMMM/.test(formatString) | 0], str); 35 | result.value++; 36 | return result; 37 | } 38 | } 39 | }); 40 | return code; 41 | }; 42 | 43 | return pl; 44 | 45 | })); 46 | -------------------------------------------------------------------------------- /locale/pt.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/ro.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/ro.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.ro = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Romanian (ro) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var ro = function (date) { 14 | var code = 'ro'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'], 19 | MMM: ['ian.', 'febr.', 'mart.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.'], 20 | dddd: ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'], 21 | ddd: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'], 22 | dd: ['Du', 'Lu', 'Ma', 'Mi', 'Jo', 'Vi', 'Sâ'] 23 | } 24 | }); 25 | return code; 26 | }; 27 | 28 | return ro; 29 | 30 | })); 31 | -------------------------------------------------------------------------------- /locale/ru.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/rw.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/rw.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.rw = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Kinyarwanda (rw) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var rw = function (date) { 14 | var code = 'rw'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['Mutarama', 'Gashyantare', 'Werurwe', 'Mata', 'Gicurasi', 'Kamena', 'Nyakanga', 'Kanama', 'Nzeri', 'Ukwakira', 'Ugushyingo', 'Ukuboza'], 19 | MMM: ['Mtr', 'Gas', 'Wer', 'Mta', 'Gic', 'Kmn', 'Nyk', 'Knm', 'Nze', 'Ukw', 'Ugu', 'Uku'], 20 | dddd: ['Ku cyumweru', 'Ku wambere', 'Ku wakabiri', 'Ku wagatatu', 'Ku wakane', 'Ku wagatanu', 'Ku wagatandatu'], 21 | ddd: ['Cyu', 'Mbe', 'Kbr', 'Gtt', 'Kne', 'Gtn', 'Gtd'], 22 | dd: ['Cy', 'Mb', 'Kb', 'Gt', 'Kn', 'Gn', 'Gd'] 23 | } 24 | }); 25 | return code; 26 | }; 27 | 28 | return rw; 29 | 30 | })); 31 | -------------------------------------------------------------------------------- /locale/sr.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/sr.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.sr = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Serbian (sr) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var sr = function (date) { 14 | var code = 'sr'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], 19 | MMM: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], 20 | dddd: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], 21 | ddd: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], 22 | dd: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'] 23 | } 24 | }); 25 | return code; 26 | }; 27 | 28 | return sr; 29 | 30 | })); 31 | -------------------------------------------------------------------------------- /locale/sv.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/sv.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.sv = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Swedish (SV) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var sv = function (date) { 14 | var code = 'sv'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'], 19 | MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 20 | dddd: ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'], 21 | ddd: ['sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör'], 22 | dd: ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö'] 23 | } 24 | }); 25 | return code; 26 | }; 27 | 28 | return sv; 29 | 30 | })); 31 | -------------------------------------------------------------------------------- /locale/th.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/th.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.th = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Thai (th) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var th = function (date) { 14 | var code = 'th'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'], 19 | MMM: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'], 20 | dddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'], 21 | ddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'], 22 | dd: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], 23 | A: ['ก่อนเที่ยง', 'หลังเที่ยง'] 24 | } 25 | }); 26 | return code; 27 | }; 28 | 29 | return th; 30 | 31 | })); 32 | -------------------------------------------------------------------------------- /locale/tr.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/tr.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.tr = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Turkish (tr) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var tr = function (date) { 14 | var code = 'tr'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'], 19 | MMM: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'], 20 | dddd: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'], 21 | ddd: ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'], 22 | dd: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'] 23 | } 24 | }); 25 | return code; 26 | }; 27 | 28 | return tr; 29 | 30 | })); 31 | -------------------------------------------------------------------------------- /locale/uk.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/uz.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/uz.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.uz = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Uzbek (uz) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var uz = function (date) { 14 | var code = 'uz'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'], 19 | MMM: ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], 20 | dddd: ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'], 21 | ddd: ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], 22 | dd: ['Як', 'Ду', 'Се', 'Чо', 'Па', 'Жу', 'Ша'] 23 | } 24 | }); 25 | return code; 26 | }; 27 | 28 | return uz; 29 | 30 | })); 31 | -------------------------------------------------------------------------------- /locale/vi.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/vi.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.vi = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js locale configuration 9 | * @preserve Vietnamese (vi) 10 | * @preserve It is using moment.js locale configuration as a reference. 11 | */ 12 | 13 | var vi = function (date) { 14 | var code = 'vi'; 15 | 16 | date.locale(code, { 17 | res: { 18 | MMMM: ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12'], 19 | MMM: ['Th01', 'Th02', 'Th03', 'Th04', 'Th05', 'Th06', 'Th07', 'Th08', 'Th09', 'Th10', 'Th11', 'Th12'], 20 | dddd: ['chủ nhật', 'thứ hai', 'thứ ba', 'thứ tư', 'thứ năm', 'thứ sáu', 'thứ bảy'], 21 | ddd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], 22 | dd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], 23 | A: ['sa', 'ch'] 24 | } 25 | }); 26 | return code; 27 | }; 28 | 29 | return vi; 30 | 31 | })); 32 | -------------------------------------------------------------------------------- /locale/zh-cn.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /locale/zh-tw.d.ts: -------------------------------------------------------------------------------- 1 | export default function (date: unknown): string; 2 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "date-and-time", 3 | "version": "3.6.0", 4 | "description": "A Minimalist DateTime utility for Node.js and the browser", 5 | "main": "date-and-time.js", 6 | "module": "esm/date-and-time.es.js", 7 | "types": "date-and-time.d.ts", 8 | "unpkg": "date-and-time.min.js", 9 | "exports": { 10 | ".": { 11 | "types": "./date-and-time.d.ts", 12 | "import": "./esm/date-and-time.mjs", 13 | "require": "./date-and-time.js", 14 | "browser": "./esm/date-and-time.es.js" 15 | }, 16 | "./locale/*": { 17 | "types": "./locale/*.d.ts", 18 | "import": "./esm/locale/*.mjs", 19 | "require": "./locale/*.js", 20 | "browser": "./esm/locale/*.es.js" 21 | }, 22 | "./plugin/*": { 23 | "types": "./plugin/*.d.ts", 24 | "import": "./esm/plugin/*.mjs", 25 | "require": "./plugin/*.js", 26 | "browser": "./esm/plugin/*.es.js" 27 | } 28 | }, 29 | "scripts": { 30 | "build": "rollup -c", 31 | "test": "./test.sh", 32 | "test:ts": "tsd ./test/ts" 33 | }, 34 | "repository": { 35 | "type": "git", 36 | "url": "https://github.com/knowledgecode/date-and-time.git" 37 | }, 38 | "keywords": [ 39 | "date", 40 | "time", 41 | "format", 42 | "parse", 43 | "utility" 44 | ], 45 | "author": "KNOWLEDGECODE", 46 | "license": "MIT", 47 | "bugs": { 48 | "url": "https://github.com/knowledgecode/date-and-time/issues" 49 | }, 50 | "homepage": "https://github.com/knowledgecode/date-and-time", 51 | "devDependencies": { 52 | "@rollup/plugin-terser": "^0.4.4", 53 | "expect.js": "^0.3.1", 54 | "mocha": "^10.7.3", 55 | "rollup": "^4.22.5", 56 | "tsd": "^0.31.2" 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /plugin/day-of-week.d.ts: -------------------------------------------------------------------------------- 1 | export default function (proto: unknown, date?: unknown): string; 2 | -------------------------------------------------------------------------------- /plugin/day-of-week.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin["day-of-week"] = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js plugin 9 | * @preserve day-of-week 10 | */ 11 | 12 | var plugin = function (date) { 13 | var name = 'day-of-week'; 14 | 15 | date.plugin(name, { 16 | parser: { 17 | dddd: function (str) { return this.find(this.res.dddd, str); }, 18 | ddd: function (str) { return this.find(this.res.ddd, str); }, 19 | dd: function (str) { return this.find(this.res.dd, str); } 20 | } 21 | }); 22 | return name; 23 | }; 24 | 25 | return plugin; 26 | 27 | })); 28 | -------------------------------------------------------------------------------- /plugin/meridiem.d.ts: -------------------------------------------------------------------------------- 1 | export default function (proto: unknown, date?: unknown): string; 2 | -------------------------------------------------------------------------------- /plugin/meridiem.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin.meridiem = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js plugin 9 | * @preserve meridiem 10 | */ 11 | 12 | var plugin = function (date) { 13 | var name = 'meridiem'; 14 | 15 | date.plugin(name, { 16 | res: { 17 | AA: ['A.M.', 'P.M.'], 18 | a: ['am', 'pm'], 19 | aa: ['a.m.', 'p.m.'] 20 | }, 21 | formatter: { 22 | AA: function (d) { 23 | return this.res.AA[d.getHours() > 11 | 0]; 24 | }, 25 | a: function (d) { 26 | return this.res.a[d.getHours() > 11 | 0]; 27 | }, 28 | aa: function (d) { 29 | return this.res.aa[d.getHours() > 11 | 0]; 30 | } 31 | }, 32 | parser: { 33 | AA: function (str) { 34 | var result = this.find(this.res.AA, str); 35 | result.token = 'A'; 36 | return result; 37 | }, 38 | a: function (str) { 39 | var result = this.find(this.res.a, str); 40 | result.token = 'A'; 41 | return result; 42 | }, 43 | aa: function (str) { 44 | var result = this.find(this.res.aa, str); 45 | result.token = 'A'; 46 | return result; 47 | } 48 | } 49 | }); 50 | return name; 51 | }; 52 | 53 | return plugin; 54 | 55 | })); 56 | -------------------------------------------------------------------------------- /plugin/microsecond.d.ts: -------------------------------------------------------------------------------- 1 | export default function (proto: unknown, date?: unknown): string; 2 | -------------------------------------------------------------------------------- /plugin/microsecond.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin.microsecond = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js plugin 9 | * @preserve microsecond 10 | */ 11 | 12 | var plugin = function (date) { 13 | var name = 'microsecond'; 14 | 15 | date.plugin(name, { 16 | parser: { 17 | SSSSSS: function (str) { 18 | var result = this.exec(/^\d{1,6}/, str); 19 | result.value = result.value / 1000 | 0; 20 | return result; 21 | }, 22 | SSSSS: function (str) { 23 | var result = this.exec(/^\d{1,5}/, str); 24 | result.value = result.value / 100 | 0; 25 | return result; 26 | }, 27 | SSSS: function (str) { 28 | var result = this.exec(/^\d{1,4}/, str); 29 | result.value = result.value / 10 | 0; 30 | return result; 31 | } 32 | } 33 | }); 34 | return name; 35 | }; 36 | 37 | return plugin; 38 | 39 | })); 40 | -------------------------------------------------------------------------------- /plugin/ordinal.d.ts: -------------------------------------------------------------------------------- 1 | export default function (proto: unknown, date?: unknown): string; 2 | -------------------------------------------------------------------------------- /plugin/ordinal.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin.ordinal = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js plugin 9 | * @preserve ordinal 10 | */ 11 | 12 | var plugin = function (date) { 13 | var name = 'ordinal'; 14 | 15 | date.plugin(name, { 16 | formatter: { 17 | DDD: function (d) { 18 | var day = d.getDate(); 19 | 20 | switch (day) { 21 | case 1: 22 | case 21: 23 | case 31: 24 | return day + 'st'; 25 | case 2: 26 | case 22: 27 | return day + 'nd'; 28 | case 3: 29 | case 23: 30 | return day + 'rd'; 31 | default: 32 | return day + 'th'; 33 | } 34 | } 35 | } 36 | }); 37 | return name; 38 | }; 39 | 40 | return plugin; 41 | 42 | })); 43 | -------------------------------------------------------------------------------- /plugin/timespan.d.ts: -------------------------------------------------------------------------------- 1 | declare module '../date-and-time' { 2 | export type TimeSpanResult = { 3 | /** Returns the result value in milliseconds. */ 4 | toMilliseconds: (formatString: string) => string, 5 | /** Returns the result value in seconds. */ 6 | toSeconds: (formatString: string) => string, 7 | /** Returns the result value in minutes. */ 8 | toMinutes: (formatString: string) => string, 9 | /** Returns the result value in hours. */ 10 | toHours: (formatString: string) => string, 11 | /** Returns the result value in days. */ 12 | toDays: (formatString: string) => string 13 | }; 14 | 15 | /** 16 | * Subtracting two dates (date1 - date2) 17 | * @param date1 - A Date object 18 | * @param date2 - A Date object 19 | * @returns The result object of subtracting date2 from date1 20 | */ 21 | export function timeSpan(date1: Date, date2: Date): TimeSpanResult; 22 | } 23 | 24 | export default function (proto: unknown, date?: unknown): string; 25 | -------------------------------------------------------------------------------- /plugin/two-digit-year.d.ts: -------------------------------------------------------------------------------- 1 | export default function (proto: unknown, date?: unknown): string; 2 | -------------------------------------------------------------------------------- /plugin/two-digit-year.js: -------------------------------------------------------------------------------- 1 | (function (global, factory) { 2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 3 | typeof define === 'function' && define.amd ? define(factory) : 4 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.plugin = global.date.plugin || {}, global.date.plugin["two-digit-year"] = factory())); 5 | })(this, (function () { 'use strict'; 6 | 7 | /** 8 | * @preserve date-and-time.js plugin 9 | * @preserve two-digit-year 10 | */ 11 | 12 | var plugin = function (date) { 13 | var name = 'two-digit-year'; 14 | 15 | date.plugin(name, { 16 | parser: { 17 | YY: function (str) { 18 | var result = this.exec(/^\d\d/, str); 19 | result.value += result.value < 70 ? 2000 : 1900; 20 | return result; 21 | } 22 | } 23 | }); 24 | return name; 25 | }; 26 | 27 | return plugin; 28 | 29 | })); 30 | -------------------------------------------------------------------------------- /src/locale/ar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Arabic (ar) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ar = function (date) { 8 | var code = 'ar'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'], 13 | MMM: ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'], 14 | dddd: ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], 15 | ddd: ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], 16 | dd: ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], 17 | A: ['ص', 'م'] 18 | }, 19 | formatter: { 20 | post: function (str) { 21 | var num = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩']; 22 | return str.replace(/\d/g, function (i) { 23 | return num[i | 0]; 24 | }); 25 | } 26 | }, 27 | parser: { 28 | pre: function (str) { 29 | var map = { '٠': 0, '١': 1, '٢': 2, '٣': 3, '٤': 4, '٥': 5, '٦': 6, '٧': 7, '٨': 8, '٩': 9 }; 30 | return str.replace(/[٠١٢٣٤٥٦٧٨٩]/g, function (i) { 31 | return '' + map[i]; 32 | }); 33 | } 34 | } 35 | }); 36 | return code; 37 | }; 38 | 39 | export default ar; 40 | -------------------------------------------------------------------------------- /src/locale/az.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Azerbaijani (az) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var az = function (date) { 8 | var code = 'az'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], 13 | MMM: ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'], 14 | dddd: ['Bazar', 'Bazar ertəsi', 'Çərşənbə axşamı', 'Çərşənbə', 'Cümə axşamı', 'Cümə', 'Şənbə'], 15 | ddd: ['Baz', 'BzE', 'ÇAx', 'Çər', 'CAx', 'Cüm', 'Şən'], 16 | dd: ['Bz', 'BE', 'ÇA', 'Çə', 'CA', 'Cü', 'Şə'], 17 | A: ['gecə', 'səhər', 'gündüz', 'axşam'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // gecə 24 | } else if (h < 12) { 25 | return this.res.A[1]; // səhər 26 | } else if (h < 17) { 27 | return this.res.A[2]; // gündüz 28 | } 29 | return this.res.A[3]; // axşam 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 2) { 35 | return h; // gecə, səhər 36 | } 37 | return h > 11 ? h : h + 12; // gündüz, axşam 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export default az; 45 | -------------------------------------------------------------------------------- /src/locale/bn.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Bengali (bn) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var bn = function (date) { 8 | var code = 'bn'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['জানুয়ারী', 'ফেবুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'অগাস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], 13 | MMM: ['জানু', 'ফেব', 'মার্চ', 'এপর', 'মে', 'জুন', 'জুল', 'অগ', 'সেপ্ট', 'অক্টো', 'নভ', 'ডিসেম্'], 14 | dddd: ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পত্তিবার', 'শুক্রবার', 'শনিবার'], 15 | ddd: ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পত্তি', 'শুক্র', 'শনি'], 16 | dd: ['রব', 'সম', 'মঙ্গ', 'বু', 'ব্রিহ', 'শু', 'শনি'], 17 | A: ['রাত', 'সকাল', 'দুপুর', 'বিকাল'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // রাত 24 | } else if (h < 10) { 25 | return this.res.A[1]; // সকাল 26 | } else if (h < 17) { 27 | return this.res.A[2]; // দুপুর 28 | } else if (h < 20) { 29 | return this.res.A[3]; // বিকাল 30 | } 31 | return this.res.A[0]; // রাত 32 | } 33 | }, 34 | parser: { 35 | h12: function (h, a) { 36 | if (a < 1) { 37 | return h < 4 || h > 11 ? h : h + 12; // রাত 38 | } else if (a < 2) { 39 | return h; // সকাল 40 | } else if (a < 3) { 41 | return h > 9 ? h : h + 12; // দুপুর 42 | } 43 | return h + 12; // বিকাল 44 | } 45 | } 46 | }); 47 | return code; 48 | }; 49 | 50 | export default bn; 51 | -------------------------------------------------------------------------------- /src/locale/cs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Czech (cs) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var cs = function (date) { 8 | var code = 'cs'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'], 13 | MMM: ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'], 14 | dddd: ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], 15 | ddd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], 16 | dd: ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export default cs; 23 | -------------------------------------------------------------------------------- /src/locale/de.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve German (de) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var de = function (date) { 8 | var code = 'de'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], 13 | MMM: ['Jan.', 'Febr.', 'Mrz.', 'Apr.', 'Mai', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'], 14 | dddd: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], 15 | ddd: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'], 16 | dd: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], 17 | A: ['Uhr nachmittags', 'Uhr morgens'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export default de; 24 | -------------------------------------------------------------------------------- /src/locale/dk.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Danish (DK) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var dk = function (date) { 8 | var code = 'dk'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'], 13 | MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 14 | dddd: ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], 15 | ddd: ['søn', 'man', 'tir', 'ons', 'tors', 'fre', 'lør'], 16 | dd: ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export default dk; 23 | -------------------------------------------------------------------------------- /src/locale/el.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Greek (el) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var el = function (date) { 8 | var code = 'el'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: [ 13 | ['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'], 14 | ['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου'] 15 | ], 16 | MMM: ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'], 17 | dddd: ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'], 18 | ddd: ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'], 19 | dd: ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'], 20 | A: ['πμ', 'μμ'] 21 | }, 22 | formatter: { 23 | MMMM: function (d, formatString) { 24 | return this.res.MMMM[/D.*MMMM/.test(formatString) | 0][d.getMonth()]; 25 | }, 26 | hh: function (d) { 27 | return ('0' + d.getHours() % 12).slice(-2); 28 | }, 29 | h: function (d) { 30 | return d.getHours() % 12; 31 | } 32 | }, 33 | parser: { 34 | MMMM: function (str, formatString) { 35 | var result = this.find(this.res.MMMM[/D.*MMMM/.test(formatString) | 0], str); 36 | result.value++; 37 | return result; 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export default el; 45 | -------------------------------------------------------------------------------- /src/locale/en.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Englis (en) 4 | * @preserve This is a dummy module. 5 | */ 6 | 7 | var en = function (date) { 8 | var code = 'en'; 9 | 10 | return code; 11 | }; 12 | 13 | export default en; 14 | -------------------------------------------------------------------------------- /src/locale/es.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Spanish (es) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var es = function (date) { 8 | var code = 'es'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], 13 | MMM: ['ene.', 'feb.', 'mar.', 'abr.', 'may.', 'jun.', 'jul.', 'ago.', 'sep.', 'oct.', 'nov.', 'dic.'], 14 | dddd: ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'], 15 | ddd: ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'], 16 | dd: ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'], 17 | A: ['de la mañana', 'de la tarde', 'de la noche'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 12) { 23 | return this.res.A[0]; // de la mañana 24 | } else if (h < 19) { 25 | return this.res.A[1]; // de la tarde 26 | } 27 | return this.res.A[2]; // de la noche 28 | } 29 | }, 30 | parser: { 31 | h12: function (h, a) { 32 | if (a < 1) { 33 | return h; // de la mañana 34 | } 35 | return h > 11 ? h : h + 12; // de la tarde, de la noche 36 | } 37 | } 38 | }); 39 | return code; 40 | }; 41 | 42 | export default es; 43 | -------------------------------------------------------------------------------- /src/locale/fa.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Persian (fa) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var fa = function (date) { 8 | var code = 'fa'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 13 | MMM: ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], 14 | dddd: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه'], 15 | ddd: ['یک‌شنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنج‌شنبه', 'جمعه', 'شنبه'], 16 | dd: ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'], 17 | A: ['قبل از ظهر', 'بعد از ظهر'] 18 | }, 19 | formatter: { 20 | post: function (str) { 21 | var num = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']; 22 | return str.replace(/\d/g, function (i) { 23 | return num[i | 0]; 24 | }); 25 | } 26 | }, 27 | parser: { 28 | pre: function (str) { 29 | var map = { '۰': 0, '۱': 1, '۲': 2, '۳': 3, '۴': 4, '۵': 5, '۶': 6, '۷': 7, '۸': 8, '۹': 9 }; 30 | return str.replace(/[۰۱۲۳۴۵۶۷۸۹]/g, function (i) { 31 | return '' + map[i]; 32 | }); 33 | } 34 | } 35 | }); 36 | return code; 37 | }; 38 | 39 | export default fa; 40 | -------------------------------------------------------------------------------- /src/locale/fr.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve French (fr) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var fr = function (date) { 8 | var code = 'fr'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], 13 | MMM: ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], 14 | dddd: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], 15 | ddd: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], 16 | dd: ['Di', 'Lu', 'Ma', 'Me', 'Je', 'Ve', 'Sa'], 17 | A: ['matin', 'l\'après-midi'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export default fr; 24 | -------------------------------------------------------------------------------- /src/locale/hi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Hindi (hi) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var hi = function (date) { 8 | var code = 'hi'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], 13 | MMM: ['जन.', 'फ़र.', 'मार्च', 'अप्रै.', 'मई', 'जून', 'जुल.', 'अग.', 'सित.', 'अक्टू.', 'नव.', 'दिस.'], 14 | dddd: ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'], 15 | ddd: ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरू', 'शुक्र', 'शनि'], 16 | dd: ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'], 17 | A: ['रात', 'सुबह', 'दोपहर', 'शाम'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // रात 24 | } else if (h < 10) { 25 | return this.res.A[1]; // सुबह 26 | } else if (h < 17) { 27 | return this.res.A[2]; // दोपहर 28 | } else if (h < 20) { 29 | return this.res.A[3]; // शाम 30 | } 31 | return this.res.A[0]; // रात 32 | } 33 | }, 34 | parser: { 35 | h12: function (h, a) { 36 | if (a < 1) { 37 | return h < 4 || h > 11 ? h : h + 12; // रात 38 | } else if (a < 2) { 39 | return h; // सुबह 40 | } else if (a < 3) { 41 | return h > 9 ? h : h + 12; // दोपहर 42 | } 43 | return h + 12; // शाम 44 | } 45 | } 46 | }); 47 | return code; 48 | }; 49 | 50 | export default hi; 51 | -------------------------------------------------------------------------------- /src/locale/hu.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Hungarian (hu) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var hu = function (date) { 8 | var code = 'hu'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'], 13 | MMM: ['jan', 'feb', 'márc', 'ápr', 'máj', 'jún', 'júl', 'aug', 'szept', 'okt', 'nov', 'dec'], 14 | dddd: ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'], 15 | ddd: ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'], 16 | dd: ['v', 'h', 'k', 'sze', 'cs', 'p', 'szo'], 17 | A: ['de', 'du'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export default hu; 24 | -------------------------------------------------------------------------------- /src/locale/id.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Indonesian (id) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var id = function (date) { 8 | var code = 'id'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'], 13 | MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'], 14 | dddd: ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'], 15 | ddd: ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'], 16 | dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'], 17 | A: ['pagi', 'siang', 'sore', 'malam'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 11) { 23 | return this.res.A[0]; // pagi 24 | } else if (h < 15) { 25 | return this.res.A[1]; // siang 26 | } else if (h < 19) { 27 | return this.res.A[2]; // sore 28 | } 29 | return this.res.A[3]; // malam 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 1) { 35 | return h; // pagi 36 | } else if (a < 2) { 37 | return h >= 11 ? h : h + 12; // siang 38 | } 39 | return h + 12; // sore, malam 40 | } 41 | } 42 | }); 43 | return code; 44 | }; 45 | 46 | export default id; 47 | -------------------------------------------------------------------------------- /src/locale/it.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Italian (it) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var it = function (date) { 8 | var code = 'it'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'], 13 | MMM: ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'], 14 | dddd: ['Domenica', 'Lunedì', 'Martedì', 'Mercoledì', 'Giovedì', 'Venerdì', 'Sabato'], 15 | ddd: ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'], 16 | dd: ['Do', 'Lu', 'Ma', 'Me', 'Gi', 'Ve', 'Sa'], 17 | A: ['di mattina', 'di pomerrigio'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export default it; 24 | -------------------------------------------------------------------------------- /src/locale/ja.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Japanese (ja) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ja = function (date) { 8 | var code = 'ja'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 13 | MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 14 | dddd: ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'], 15 | ddd: ['日', '月', '火', '水', '木', '金', '土'], 16 | dd: ['日', '月', '火', '水', '木', '金', '土'], 17 | A: ['午前', '午後'] 18 | }, 19 | formatter: { 20 | hh: function (d) { 21 | return ('0' + d.getHours() % 12).slice(-2); 22 | }, 23 | h: function (d) { 24 | return d.getHours() % 12; 25 | } 26 | } 27 | }); 28 | return code; 29 | }; 30 | 31 | export default ja; 32 | -------------------------------------------------------------------------------- /src/locale/jv.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Javanese (jv) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var jv = function (date) { 8 | var code = 'jv'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'], 13 | MMM: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nop', 'Des'], 14 | dddd: ['Minggu', 'Senen', 'Seloso', 'Rebu', 'Kemis', 'Jemuwah', 'Septu'], 15 | ddd: ['Min', 'Sen', 'Sel', 'Reb', 'Kem', 'Jem', 'Sep'], 16 | dd: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sp'], 17 | A: ['enjing', 'siyang', 'sonten', 'ndalu'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 11) { 23 | return this.res.A[0]; // enjing 24 | } else if (h < 15) { 25 | return this.res.A[1]; // siyang 26 | } else if (h < 19) { 27 | return this.res.A[2]; // sonten 28 | } 29 | return this.res.A[3]; // ndalu 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 1) { 35 | return h; // enjing 36 | } else if (a < 2) { 37 | return h >= 11 ? h : h + 12; // siyang 38 | } 39 | return h + 12; // sonten, ndalu 40 | } 41 | } 42 | }); 43 | return code; 44 | }; 45 | 46 | export default jv; 47 | -------------------------------------------------------------------------------- /src/locale/ko.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Korean (ko) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ko = function (date) { 8 | var code = 'ko'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 13 | MMM: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 14 | dddd: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'], 15 | ddd: ['일', '월', '화', '수', '목', '금', '토'], 16 | dd: ['일', '월', '화', '수', '목', '금', '토'], 17 | A: ['오전', '오후'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export default ko; 24 | -------------------------------------------------------------------------------- /src/locale/my.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Burmese (my) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var my = function (date) { 8 | var code = 'my'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'သြဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'], 13 | MMM: ['ဇန်', 'ဖေ', 'မတ်', 'ပြီ', 'မေ', 'ဇွန်', 'လိုင်', 'သြ', 'စက်', 'အောက်', 'နို', 'ဒီ'], 14 | dddd: ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'], 15 | ddd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], 16 | dd: ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'] 17 | }, 18 | formatter: { 19 | post: function (str) { 20 | var num = ['၀', '၁', '၂', '၃', '၄', '၅', '၆', '၇', '၈', '၉']; 21 | return str.replace(/\d/g, function (i) { 22 | return num[i | 0]; 23 | }); 24 | } 25 | }, 26 | parser: { 27 | pre: function (str) { 28 | var map = { '၀': 0, '၁': 1, '၂': 2, '၃': 3, '၄': 4, '၅': 5, '၆': 6, '၇': 7, '၈': 8, '၉': 9 }; 29 | return str.replace(/[၀၁၂၃၄၅၆၇၈၉]/g, function (i) { 30 | return '' + map[i]; 31 | }); 32 | } 33 | } 34 | }); 35 | return code; 36 | }; 37 | 38 | export default my; 39 | -------------------------------------------------------------------------------- /src/locale/nl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Dutch (nl) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var nl = function (date) { 8 | var code = 'nl'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], 13 | MMM: [ 14 | ['jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'], 15 | ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'] 16 | ], 17 | dddd: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], 18 | ddd: ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'], 19 | dd: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za'] 20 | }, 21 | formatter: { 22 | MMM: function (d, formatString) { 23 | return this.res.MMM[/-MMM-/.test(formatString) | 0][d.getMonth()]; 24 | } 25 | }, 26 | parser: { 27 | MMM: function (str, formatString) { 28 | var result = this.find(this.res.MMM[/-MMM-/.test(formatString) | 0], str); 29 | result.value++; 30 | return result; 31 | } 32 | } 33 | }); 34 | return code; 35 | }; 36 | 37 | export default nl; 38 | -------------------------------------------------------------------------------- /src/locale/pl.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Polish (pl) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var pl = function (date) { 8 | var code = 'pl'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: [ 13 | ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'], 14 | ['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia'] 15 | ], 16 | MMM: ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'], 17 | dddd: ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'], 18 | ddd: ['nie', 'pon', 'wt', 'śr', 'czw', 'pt', 'sb'], 19 | dd: ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'] 20 | }, 21 | formatter: { 22 | MMMM: function (d, formatString) { 23 | return this.res.MMMM[/D MMMM/.test(formatString) | 0][d.getMonth()]; 24 | } 25 | }, 26 | parser: { 27 | MMMM: function (str, formatString) { 28 | var result = this.find(this.res.MMMM[/D MMMM/.test(formatString) | 0], str); 29 | result.value++; 30 | return result; 31 | } 32 | } 33 | }); 34 | return code; 35 | }; 36 | 37 | export default pl; 38 | -------------------------------------------------------------------------------- /src/locale/pt.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Portuguese (pt) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var pt = function (date) { 8 | var code = 'pt'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'], 13 | MMM: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'], 14 | dddd: ['Domingo', 'Segunda-Feira', 'Terça-Feira', 'Quarta-Feira', 'Quinta-Feira', 'Sexta-Feira', 'Sábado'], 15 | ddd: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sáb'], 16 | dd: ['Dom', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sáb'], 17 | A: ['da madrugada', 'da manhã', 'da tarde', 'da noite'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 5) { 23 | return this.res.A[0]; // da madrugada 24 | } else if (h < 12) { 25 | return this.res.A[1]; // da manhã 26 | } else if (h < 19) { 27 | return this.res.A[2]; // da tarde 28 | } 29 | return this.res.A[3]; // da noite 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 2) { 35 | return h; // da madrugada, da manhã 36 | } 37 | return h > 11 ? h : h + 12; // da tarde, da noite 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export default pt; 45 | -------------------------------------------------------------------------------- /src/locale/ro.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Romanian (ro) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ro = function (date) { 8 | var code = 'ro'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'], 13 | MMM: ['ian.', 'febr.', 'mart.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.'], 14 | dddd: ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'], 15 | ddd: ['Dum', 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sâm'], 16 | dd: ['Du', 'Lu', 'Ma', 'Mi', 'Jo', 'Vi', 'Sâ'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export default ro; 23 | -------------------------------------------------------------------------------- /src/locale/ru.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Russian (ru) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var ru = function (date) { 8 | var code = 'ru'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Января', 'Февраля', 'Марта', 'Апреля', 'Мая', 'Июня', 'Июля', 'Августа', 'Сентября', 'Октября', 'Ноября', 'Декабря'], 13 | MMM: ['янв', 'фев', 'мар', 'апр', 'мая', 'июня', 'июля', 'авг', 'сен', 'окт', 'ноя', 'дек'], 14 | dddd: ['Воскресенье', 'Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота'], 15 | ddd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], 16 | dd: ['Вс', 'Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб'], 17 | A: ['ночи', 'утра', 'дня', 'вечера'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var h = d.getHours(); 22 | if (h < 4) { 23 | return this.res.A[0]; // ночи 24 | } else if (h < 12) { 25 | return this.res.A[1]; // утра 26 | } else if (h < 17) { 27 | return this.res.A[2]; // дня 28 | } 29 | return this.res.A[3]; // вечера 30 | } 31 | }, 32 | parser: { 33 | h12: function (h, a) { 34 | if (a < 2) { 35 | return h; // ночи, утра 36 | } 37 | return h > 11 ? h : h + 12; // дня, вечера 38 | } 39 | } 40 | }); 41 | return code; 42 | }; 43 | 44 | export default ru; 45 | -------------------------------------------------------------------------------- /src/locale/rw.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Kinyarwanda (rw) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var rw = function (date) { 8 | var code = 'rw'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Mutarama', 'Gashyantare', 'Werurwe', 'Mata', 'Gicurasi', 'Kamena', 'Nyakanga', 'Kanama', 'Nzeri', 'Ukwakira', 'Ugushyingo', 'Ukuboza'], 13 | MMM: ['Mtr', 'Gas', 'Wer', 'Mta', 'Gic', 'Kmn', 'Nyk', 'Knm', 'Nze', 'Ukw', 'Ugu', 'Uku'], 14 | dddd: ['Ku cyumweru', 'Ku wambere', 'Ku wakabiri', 'Ku wagatatu', 'Ku wakane', 'Ku wagatanu', 'Ku wagatandatu'], 15 | ddd: ['Cyu', 'Mbe', 'Kbr', 'Gtt', 'Kne', 'Gtn', 'Gtd'], 16 | dd: ['Cy', 'Mb', 'Kb', 'Gt', 'Kn', 'Gn', 'Gd'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export default rw; 23 | -------------------------------------------------------------------------------- /src/locale/sr.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Serbian (sr) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var sr = function (date) { 8 | var code = 'sr'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], 13 | MMM: ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], 14 | dddd: ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], 15 | ddd: ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], 16 | dd: ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export default sr; 23 | -------------------------------------------------------------------------------- /src/locale/sv.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Swedish (SV) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var sv = function (date) { 8 | var code = 'sv'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'], 13 | MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], 14 | dddd: ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'], 15 | ddd: ['sön', 'mån', 'tis', 'ons', 'tor', 'fre', 'lör'], 16 | dd: ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export default sv; 23 | -------------------------------------------------------------------------------- /src/locale/th.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Thai (th) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var th = function (date) { 8 | var code = 'th'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'], 13 | MMM: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'], 14 | dddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'], 15 | ddd: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'], 16 | dd: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], 17 | A: ['ก่อนเที่ยง', 'หลังเที่ยง'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export default th; 24 | -------------------------------------------------------------------------------- /src/locale/tr.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Turkish (tr) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var tr = function (date) { 8 | var code = 'tr'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'], 13 | MMM: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'], 14 | dddd: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'], 15 | ddd: ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'], 16 | dd: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export default tr; 23 | -------------------------------------------------------------------------------- /src/locale/uz.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Uzbek (uz) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var uz = function (date) { 8 | var code = 'uz'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'], 13 | MMM: ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], 14 | dddd: ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'], 15 | ddd: ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], 16 | dd: ['Як', 'Ду', 'Се', 'Чо', 'Па', 'Жу', 'Ша'] 17 | } 18 | }); 19 | return code; 20 | }; 21 | 22 | export default uz; 23 | -------------------------------------------------------------------------------- /src/locale/vi.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Vietnamese (vi) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var vi = function (date) { 8 | var code = 'vi'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12'], 13 | MMM: ['Th01', 'Th02', 'Th03', 'Th04', 'Th05', 'Th06', 'Th07', 'Th08', 'Th09', 'Th10', 'Th11', 'Th12'], 14 | dddd: ['chủ nhật', 'thứ hai', 'thứ ba', 'thứ tư', 'thứ năm', 'thứ sáu', 'thứ bảy'], 15 | ddd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], 16 | dd: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], 17 | A: ['sa', 'ch'] 18 | } 19 | }); 20 | return code; 21 | }; 22 | 23 | export default vi; 24 | -------------------------------------------------------------------------------- /src/locale/zh-cn.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Chinese (zh-cn) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var zh_cn = function (date) { 8 | var code = 'zh-cn'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 13 | MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 14 | dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 15 | ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], 16 | dd: ['日', '一', '二', '三', '四', '五', '六'], 17 | A: ['凌晨', '早上', '上午', '中午', '下午', '晚上'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var hm = d.getHours() * 100 + d.getMinutes(); 22 | if (hm < 600) { 23 | return this.res.A[0]; // 凌晨 24 | } else if (hm < 900) { 25 | return this.res.A[1]; // 早上 26 | } else if (hm < 1130) { 27 | return this.res.A[2]; // 上午 28 | } else if (hm < 1230) { 29 | return this.res.A[3]; // 中午 30 | } else if (hm < 1800) { 31 | return this.res.A[4]; // 下午 32 | } 33 | return this.res.A[5]; // 晚上 34 | } 35 | }, 36 | parser: { 37 | h12: function (h, a) { 38 | if (a < 4) { 39 | return h; // 凌晨, 早上, 上午, 中午 40 | } 41 | return h > 11 ? h : h + 12; // 下午, 晚上 42 | } 43 | } 44 | }); 45 | return code; 46 | }; 47 | 48 | export default zh_cn; 49 | -------------------------------------------------------------------------------- /src/locale/zh-tw.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js locale configuration 3 | * @preserve Chinese (zh-tw) 4 | * @preserve It is using moment.js locale configuration as a reference. 5 | */ 6 | 7 | var zh_tw = function (date) { 8 | var code = 'zh-tw'; 9 | 10 | date.locale(code, { 11 | res: { 12 | MMMM: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], 13 | MMM: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], 14 | dddd: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], 15 | ddd: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], 16 | dd: ['日', '一', '二', '三', '四', '五', '六'], 17 | A: ['早上', '上午', '中午', '下午', '晚上'] 18 | }, 19 | formatter: { 20 | A: function (d) { 21 | var hm = d.getHours() * 100 + d.getMinutes(); 22 | if (hm < 900) { 23 | return this.res.A[0]; // 早上 24 | } else if (hm < 1130) { 25 | return this.res.A[1]; // 上午 26 | } else if (hm < 1230) { 27 | return this.res.A[2]; // 中午 28 | } else if (hm < 1800) { 29 | return this.res.A[3]; // 下午 30 | } 31 | return this.res.A[4]; // 晚上 32 | } 33 | }, 34 | parser: { 35 | h12: function (h, a) { 36 | if (a < 3) { 37 | return h; // 早上, 上午, 中午 38 | } 39 | return h > 11 ? h : h + 12; // 下午, 晚上 40 | } 41 | } 42 | }); 43 | return code; 44 | }; 45 | 46 | export default zh_tw; 47 | -------------------------------------------------------------------------------- /src/plugin/day-of-week.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve day-of-week 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'day-of-week'; 8 | 9 | date.plugin(name, { 10 | parser: { 11 | dddd: function (str) { return this.find(this.res.dddd, str); }, 12 | ddd: function (str) { return this.find(this.res.ddd, str); }, 13 | dd: function (str) { return this.find(this.res.dd, str); } 14 | } 15 | }); 16 | return name; 17 | }; 18 | 19 | export default plugin; 20 | -------------------------------------------------------------------------------- /src/plugin/meridiem.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve meridiem 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'meridiem'; 8 | 9 | date.plugin(name, { 10 | res: { 11 | AA: ['A.M.', 'P.M.'], 12 | a: ['am', 'pm'], 13 | aa: ['a.m.', 'p.m.'] 14 | }, 15 | formatter: { 16 | AA: function (d) { 17 | return this.res.AA[d.getHours() > 11 | 0]; 18 | }, 19 | a: function (d) { 20 | return this.res.a[d.getHours() > 11 | 0]; 21 | }, 22 | aa: function (d) { 23 | return this.res.aa[d.getHours() > 11 | 0]; 24 | } 25 | }, 26 | parser: { 27 | AA: function (str) { 28 | var result = this.find(this.res.AA, str); 29 | result.token = 'A'; 30 | return result; 31 | }, 32 | a: function (str) { 33 | var result = this.find(this.res.a, str); 34 | result.token = 'A'; 35 | return result; 36 | }, 37 | aa: function (str) { 38 | var result = this.find(this.res.aa, str); 39 | result.token = 'A'; 40 | return result; 41 | } 42 | } 43 | }); 44 | return name; 45 | }; 46 | 47 | export default plugin; 48 | -------------------------------------------------------------------------------- /src/plugin/microsecond.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve microsecond 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'microsecond'; 8 | 9 | date.plugin(name, { 10 | parser: { 11 | SSSSSS: function (str) { 12 | var result = this.exec(/^\d{1,6}/, str); 13 | result.value = result.value / 1000 | 0; 14 | return result; 15 | }, 16 | SSSSS: function (str) { 17 | var result = this.exec(/^\d{1,5}/, str); 18 | result.value = result.value / 100 | 0; 19 | return result; 20 | }, 21 | SSSS: function (str) { 22 | var result = this.exec(/^\d{1,4}/, str); 23 | result.value = result.value / 10 | 0; 24 | return result; 25 | } 26 | } 27 | }); 28 | return name; 29 | }; 30 | 31 | export default plugin; 32 | -------------------------------------------------------------------------------- /src/plugin/ordinal.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve ordinal 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'ordinal'; 8 | 9 | date.plugin(name, { 10 | formatter: { 11 | DDD: function (d) { 12 | var day = d.getDate(); 13 | 14 | switch (day) { 15 | case 1: 16 | case 21: 17 | case 31: 18 | return day + 'st'; 19 | case 2: 20 | case 22: 21 | return day + 'nd'; 22 | case 3: 23 | case 23: 24 | return day + 'rd'; 25 | default: 26 | return day + 'th'; 27 | } 28 | } 29 | } 30 | }); 31 | return name; 32 | }; 33 | 34 | export default plugin; 35 | -------------------------------------------------------------------------------- /src/plugin/two-digit-year.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve date-and-time.js plugin 3 | * @preserve two-digit-year 4 | */ 5 | 6 | var plugin = function (date) { 7 | var name = 'two-digit-year'; 8 | 9 | date.plugin(name, { 10 | parser: { 11 | YY: function (str) { 12 | var result = this.exec(/^\d\d/, str); 13 | result.value += result.value < 70 ? 2000 : 1900; 14 | return result; 15 | } 16 | } 17 | }); 18 | return name; 19 | }; 20 | 21 | export default plugin; 22 | -------------------------------------------------------------------------------- /test/esm/plugin/day-of-week.mjs: -------------------------------------------------------------------------------- 1 | /*global describe, before, it */ 2 | import date from 'date-and-time'; 3 | import day_of_week from 'date-and-time/plugin/day-of-week'; 4 | 5 | import expect from 'expect.js'; 6 | 7 | describe('day of week', () => { 8 | before(() => date.plugin(day_of_week)); 9 | 10 | it('dd', () => { 11 | const now = new Date(1970, 0, 1, 0, 0, 0, 0); 12 | expect(date.parse('Fr', 'dd')).to.eql(now); 13 | }); 14 | it('ddd', () => { 15 | const now = new Date(1970, 0, 1, 0, 0, 0, 0); 16 | expect(date.parse('Fri', 'ddd')).to.eql(now); 17 | }); 18 | it('dddd', () => { 19 | const now = new Date(1970, 0, 1, 0, 0, 0, 0); 20 | expect(date.parse('Friday', 'dddd')).to.eql(now); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /test/esm/plugin/microsecond.mjs: -------------------------------------------------------------------------------- 1 | /*global describe, before, it */ 2 | import date from 'date-and-time'; 3 | import microsecond from 'date-and-time/plugin/microsecond'; 4 | 5 | import expect from 'expect.js'; 6 | 7 | describe('microsecond', () => { 8 | before(() => date.plugin(microsecond)); 9 | 10 | it('SSSS', () => { 11 | const now = new Date(1970, 0, 1, 0, 0, 0, 123); 12 | expect(date.parse('0.1234', '0.SSSS')).to.eql(now); 13 | }); 14 | it('SSSSS', () => { 15 | const now = new Date(1970, 0, 1, 0, 0, 0, 12); 16 | expect(date.parse('0.01234', '0.SSSSS')).to.eql(now); 17 | }); 18 | it('SSSSSS', () => { 19 | const now = new Date(1970, 0, 1, 0, 0, 0, 1); 20 | expect(date.parse('0.001234', '0.SSSSSS')).to.eql(now); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /test/esm/plugin/ordinal.mjs: -------------------------------------------------------------------------------- 1 | /*global describe, before, it */ 2 | import date from 'date-and-time'; 3 | import ordinal from 'date-and-time/plugin/ordinal'; 4 | 5 | import expect from 'expect.js'; 6 | 7 | describe('ordinal number', () => { 8 | before(() => date.plugin(ordinal)); 9 | 10 | it('Jan. XX, 2019', () => { 11 | for (let i = 1, d, now; i <= 31; i++) { 12 | now = new Date(2019, 0, i, 12, 34, 56, 789); 13 | switch (i) { 14 | case 1: 15 | case 21: 16 | case 31: 17 | d = i + 'st'; 18 | break; 19 | case 2: 20 | case 22: 21 | d = i + 'nd'; 22 | break; 23 | case 3: 24 | case 23: 25 | d = i + 'rd'; 26 | break; 27 | default: 28 | d = i + 'th'; 29 | break; 30 | } 31 | expect(date.format(now, 'MMM. DDD, YYYY')).to.equal('Jan. ' + d + ', 2019'); 32 | } 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /test/plugin/day-of-week.js: -------------------------------------------------------------------------------- 1 | /*global describe, before, it */ 2 | (function (global) { 3 | 'use strict'; 4 | 5 | var expect = global.expect || require('expect.js'), 6 | date = global.date || require('date-and-time'); 7 | 8 | var plugin = 'day-of-week'; 9 | 10 | if (typeof require === 'function') { 11 | plugin = require('date-and-time/plugin/day-of-week'); 12 | } 13 | 14 | describe('day of week', function () { 15 | before(function () { 16 | date.plugin(plugin); 17 | }); 18 | 19 | it('dd', function () { 20 | var now = new Date(1970, 0, 1, 0, 0, 0, 0); 21 | expect(date.parse('Fr', 'dd')).to.eql(now); 22 | }); 23 | it('ddd', function () { 24 | var now = new Date(1970, 0, 1, 0, 0, 0, 0); 25 | expect(date.parse('Fri', 'ddd')).to.eql(now); 26 | }); 27 | it('dddd', function () { 28 | var now = new Date(1970, 0, 1, 0, 0, 0, 0); 29 | expect(date.parse('Friday', 'dddd')).to.eql(now); 30 | }); 31 | }); 32 | 33 | }(this)); 34 | -------------------------------------------------------------------------------- /test/plugin/microsecond.js: -------------------------------------------------------------------------------- 1 | /*global describe, before, it */ 2 | (function (global) { 3 | 'use strict'; 4 | 5 | var expect = global.expect || require('expect.js'), 6 | date = global.date || require('date-and-time'); 7 | 8 | var plugin = 'microsecond'; 9 | 10 | if (typeof require === 'function') { 11 | plugin = require('date-and-time/plugin/microsecond'); 12 | } 13 | 14 | describe('microsecond', function () { 15 | before(function () { 16 | date.plugin(plugin); 17 | }); 18 | 19 | it('SSSS', function () { 20 | var now = new Date(1970, 0, 1, 0, 0, 0, 123); 21 | expect(date.parse('0.1234', '0.SSSS')).to.eql(now); 22 | }); 23 | it('SSSSS', function () { 24 | var now = new Date(1970, 0, 1, 0, 0, 0, 12); 25 | expect(date.parse('0.01234', '0.SSSSS')).to.eql(now); 26 | }); 27 | it('SSSSSS', function () { 28 | var now = new Date(1970, 0, 1, 0, 0, 0, 1); 29 | expect(date.parse('0.001234', '0.SSSSSS')).to.eql(now); 30 | }); 31 | }); 32 | 33 | }(this)); 34 | -------------------------------------------------------------------------------- /test/plugin/ordinal.js: -------------------------------------------------------------------------------- 1 | /*global describe, before, it */ 2 | (function (global) { 3 | 'use strict'; 4 | 5 | var expect = global.expect || require('expect.js'), 6 | date = global.date || require('date-and-time'); 7 | 8 | var plugin = 'ordinal'; 9 | 10 | if (typeof require === 'function') { 11 | plugin = require('date-and-time/plugin/ordinal'); 12 | } 13 | 14 | describe('ordinal number', function () { 15 | before(function () { 16 | date.plugin(plugin); 17 | }); 18 | 19 | it('Jan. XX, 2019', function () { 20 | for (var i = 1, d, now; i <= 31; i++) { 21 | now = new Date(2019, 0, i, 12, 34, 56, 789); 22 | switch (i) { 23 | case 1: 24 | case 21: 25 | case 31: 26 | d = i + 'st'; 27 | break; 28 | case 2: 29 | case 22: 30 | d = i + 'nd'; 31 | break; 32 | case 3: 33 | case 23: 34 | d = i + 'rd'; 35 | break; 36 | default: 37 | d = i + 'th'; 38 | break; 39 | } 40 | expect(date.format(now, 'MMM. DDD, YYYY')).to.equal('Jan. ' + d + ', 2019'); 41 | } 42 | }); 43 | }); 44 | 45 | }(this)); 46 | -------------------------------------------------------------------------------- /test/ts/date-and-time.d.ts: -------------------------------------------------------------------------------- 1 | ../../date-and-time.d.ts -------------------------------------------------------------------------------- /test/ts/locale/ar.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/ar.d.ts -------------------------------------------------------------------------------- /test/ts/locale/az.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/az.d.ts -------------------------------------------------------------------------------- /test/ts/locale/bn.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/bn.d.ts -------------------------------------------------------------------------------- /test/ts/locale/cs.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/cs.d.ts -------------------------------------------------------------------------------- /test/ts/locale/de.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/de.d.ts -------------------------------------------------------------------------------- /test/ts/locale/dk.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/dk.d.ts -------------------------------------------------------------------------------- /test/ts/locale/el.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/el.d.ts -------------------------------------------------------------------------------- /test/ts/locale/en.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/en.d.ts -------------------------------------------------------------------------------- /test/ts/locale/es.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/es.d.ts -------------------------------------------------------------------------------- /test/ts/locale/fa.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/fa.d.ts -------------------------------------------------------------------------------- /test/ts/locale/fr.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/fr.d.ts -------------------------------------------------------------------------------- /test/ts/locale/hi.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/hi.d.ts -------------------------------------------------------------------------------- /test/ts/locale/hu.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/hu.d.ts -------------------------------------------------------------------------------- /test/ts/locale/id.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/id.d.ts -------------------------------------------------------------------------------- /test/ts/locale/it.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/it.d.ts -------------------------------------------------------------------------------- /test/ts/locale/ja.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/ja.d.ts -------------------------------------------------------------------------------- /test/ts/locale/jv.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/jv.d.ts -------------------------------------------------------------------------------- /test/ts/locale/ko.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/ko.d.ts -------------------------------------------------------------------------------- /test/ts/locale/my.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/my.d.ts -------------------------------------------------------------------------------- /test/ts/locale/nl.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/nl.d.ts -------------------------------------------------------------------------------- /test/ts/locale/pa-in.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/pa-in.d.ts -------------------------------------------------------------------------------- /test/ts/locale/pl.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/pl.d.ts -------------------------------------------------------------------------------- /test/ts/locale/pt.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/pt.d.ts -------------------------------------------------------------------------------- /test/ts/locale/ro.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/ro.d.ts -------------------------------------------------------------------------------- /test/ts/locale/ru.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/ru.d.ts -------------------------------------------------------------------------------- /test/ts/locale/rw.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/rw.d.ts -------------------------------------------------------------------------------- /test/ts/locale/sr.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/sr.d.ts -------------------------------------------------------------------------------- /test/ts/locale/sv.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/sv.d.ts -------------------------------------------------------------------------------- /test/ts/locale/th.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/th.d.ts -------------------------------------------------------------------------------- /test/ts/locale/tr.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/tr.d.ts -------------------------------------------------------------------------------- /test/ts/locale/uk.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/uk.d.ts -------------------------------------------------------------------------------- /test/ts/locale/uz.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/uz.d.ts -------------------------------------------------------------------------------- /test/ts/locale/vi.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/vi.d.ts -------------------------------------------------------------------------------- /test/ts/locale/zh-cn.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/zh-cn.d.ts -------------------------------------------------------------------------------- /test/ts/locale/zh-tw.d.ts: -------------------------------------------------------------------------------- 1 | ../../../locale/zh-tw.d.ts -------------------------------------------------------------------------------- /test/ts/plugin/day-of-week.d.ts: -------------------------------------------------------------------------------- 1 | ../../../plugin/day-of-week.d.ts -------------------------------------------------------------------------------- /test/ts/plugin/meridiem.d.ts: -------------------------------------------------------------------------------- 1 | ../../../plugin/meridiem.d.ts -------------------------------------------------------------------------------- /test/ts/plugin/microsecond.d.ts: -------------------------------------------------------------------------------- 1 | ../../../plugin/microsecond.d.ts -------------------------------------------------------------------------------- /test/ts/plugin/ordinal.d.ts: -------------------------------------------------------------------------------- 1 | ../../../plugin/ordinal.d.ts -------------------------------------------------------------------------------- /test/ts/plugin/timespan.d.ts: -------------------------------------------------------------------------------- 1 | ../../../plugin/timespan.d.ts -------------------------------------------------------------------------------- /test/ts/plugin/timezone.d.ts: -------------------------------------------------------------------------------- 1 | ../../../plugin/timezone.d.ts -------------------------------------------------------------------------------- /test/ts/plugin/two-digit-year.d.ts: -------------------------------------------------------------------------------- 1 | ../../../plugin/two-digit-year.d.ts --------------------------------------------------------------------------------