@verdocs/web-sdk 1.14.11 → 1.14.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Roles-9b593b95.js +28 -0
- package/dist/cjs/{TemplateStore-19f84862.js → TemplateStore-f2fb6a62.js} +1 -1
- package/dist/cjs/{index-7c19ba1d.js → index-6528b430.js} +219 -63
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-618c13f1.js → utils-f4efefe3.js} +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-button-panel_3.cjs.entry.js +27 -14
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-dropdown_2.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-envelope-recipient-summary.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-date.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-initial.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-signature.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-field-timestamp.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-organization-card.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-quick-functions_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-radio-button_3.cjs.entry.js +241 -0
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-send.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-sign.cjs.entry.js +3 -3
- package/dist/cjs/{verdocs-template-fields_4.cjs.entry.js → verdocs-template-attachments_4.cjs.entry.js} +232 -241
- package/dist/cjs/{verdocs-template-document-page_2.cjs.entry.js → verdocs-template-document-page.cjs.entry.js} +3 -48
- package/dist/cjs/verdocs-template-name.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-reminders.cjs.entry.js +2 -12
- package/dist/cjs/verdocs-template-visibility.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-toolbar-icon.cjs.entry.js +51 -0
- package/dist/cjs/verdocs-view.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +27 -14
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.stories.js +1 -1
- package/dist/components/VerdocsEndpoint.js +30 -30
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/components/index2.js +219 -63
- package/dist/components/verdocs-template-field-properties2.js +27 -13
- package/dist/components/verdocs-template-reminders.js +0 -10
- package/dist/docs.json +1 -102
- package/dist/esm/Roles-6eb459df.js +24 -0
- package/dist/esm/{TemplateStore-852097c3.js → TemplateStore-87c99dfc.js} +1 -1
- package/dist/esm/{index-914ed6f7.js → index-d264c496.js} +219 -63
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-60683446.js → utils-1bb75f32.js} +2 -2
- package/dist/esm/verdocs-auth.entry.js +1 -1
- package/dist/esm/verdocs-build.entry.js +2 -2
- package/dist/esm/verdocs-button-panel_3.entry.js +27 -14
- package/dist/esm/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm/verdocs-dropdown_2.entry.js +3 -3
- package/dist/esm/verdocs-envelope-recipient-summary.entry.js +1 -1
- package/dist/esm/verdocs-envelope-sidebar.entry.js +2 -2
- package/dist/esm/verdocs-field-checkbox.entry.js +2 -2
- package/dist/esm/verdocs-field-date.entry.js +2 -2
- package/dist/esm/verdocs-field-dropdown.entry.js +2 -2
- package/dist/esm/verdocs-field-initial.entry.js +2 -2
- package/dist/esm/verdocs-field-payment.entry.js +2 -2
- package/dist/esm/verdocs-field-radio-button.entry.js +2 -2
- package/dist/esm/verdocs-field-signature.entry.js +2 -2
- package/dist/esm/verdocs-field-textarea.entry.js +3 -3
- package/dist/esm/verdocs-field-textbox.entry.js +3 -3
- package/dist/esm/verdocs-field-timestamp.entry.js +2 -2
- package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm/verdocs-organization-card.entry.js +1 -1
- package/dist/esm/verdocs-preview.entry.js +4 -4
- package/dist/esm/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm/verdocs-radio-button_3.entry.js +235 -0
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-send.entry.js +4 -4
- package/dist/esm/verdocs-sign.entry.js +3 -3
- package/dist/esm/{verdocs-template-fields_4.entry.js → verdocs-template-attachments_4.entry.js} +229 -238
- package/dist/esm/{verdocs-template-document-page_2.entry.js → verdocs-template-document-page.entry.js} +4 -48
- package/dist/esm/verdocs-template-name.entry.js +2 -2
- package/dist/esm/verdocs-template-reminders.entry.js +2 -12
- package/dist/esm/verdocs-template-visibility.entry.js +2 -2
- package/dist/esm/verdocs-toolbar-icon.entry.js +47 -0
- package/dist/esm/verdocs-view.entry.js +3 -3
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/Roles-6eb459df.js +1 -0
- package/dist/esm-es5/{TemplateStore-852097c3.js → TemplateStore-87c99dfc.js} +1 -1
- package/dist/esm-es5/{VerdocsEndpoint-5b92f115.js → VerdocsEndpoint-6d7a17ce.js} +1 -1
- package/dist/esm-es5/index-d264c496.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{utils-60683446.js → utils-1bb75f32.js} +2 -2
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-button-panel_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-dropdown_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-summary.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-organization-card.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-radio-button_3.entry.js +1 -0
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-send.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-attachments_4.entry.js +1 -0
- package/dist/esm-es5/verdocs-template-document-page.entry.js +1 -0
- package/dist/esm-es5/verdocs-template-name.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-reminders.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-visibility.entry.js +1 -1
- package/dist/esm-es5/verdocs-toolbar-icon.entry.js +1 -0
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.d.ts +3 -2
- package/dist/types/components.d.ts +0 -29
- package/dist/verdocs-web-sdk/{p-be6d3848.entry.js → p-017dc2a9.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0177fb6c.entry.js → p-10bb1e56.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9d7fa51d.system.entry.js → p-1236c197.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-2c0d7838.system.entry.js → p-12f0c4e0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4a3b037b.system.entry.js → p-172f5d37.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c841a530.system.entry.js → p-19450d55.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-717c9fe1.entry.js → p-1c4f6ae6.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-1cf38cea.system.js +1 -1
- package/dist/verdocs-web-sdk/p-1e8d9829.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-94365585.entry.js → p-204f69c7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5cff98bd.entry.js → p-237edd0b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0529a428.system.entry.js → p-255a66f9.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3fe24d0c.system.entry.js → p-25870f11.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-27846894.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-1420d87e.system.entry.js → p-2a3de488.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9c87f6f8.system.entry.js → p-2d2bdf3c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-dc849a58.system.js → p-365a0216.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0aee25b9.entry.js → p-365a8a00.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-33640d84.entry.js → p-3a9d248d.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4b65e2f3.js → p-3ea489e9.js} +1 -1
- package/dist/verdocs-web-sdk/p-42aa31a9.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-8e386265.entry.js → p-43f5476c.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-51a3ea62.system.js +1 -0
- package/dist/verdocs-web-sdk/{p-e4ceaebf.system.entry.js → p-56c65857.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8aba7c0a.entry.js → p-5d19f075.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-5df694ab.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-21e90bbf.system.entry.js → p-7399931a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7fb69dde.entry.js → p-750fabdb.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-76b73d80.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-095a3eba.system.entry.js → p-773a2544.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0e381c36.entry.js → p-789dc7fe.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f37f1ebc.system.entry.js → p-7917673a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-8027431e.js +1 -0
- package/dist/verdocs-web-sdk/{p-73ea1ea3.entry.js → p-807dbe83.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-02a70b8e.system.entry.js → p-8109a994.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-8229e6df.system.js +1 -0
- package/dist/verdocs-web-sdk/p-83535db7.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-e2635788.system.entry.js → p-8387794f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1a0cccea.system.entry.js → p-886461cd.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-89f34463.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-fdda1309.entry.js → p-8dacb527.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f9bea98a.js → p-8fb2cf32.js} +2 -2
- package/dist/verdocs-web-sdk/{p-438daf23.entry.js → p-8fcb22ea.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ebca6188.entry.js → p-991afbb9.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3e4f73cb.system.entry.js → p-9d90ed3d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-84457a67.system.entry.js → p-9dd19ab5.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-a3931094.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-a58691dc.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-813c2fae.system.entry.js → p-a596cd4f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a5bce263.entry.js → p-a5eebbfa.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4cc5d833.system.js → p-a6258dde.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-a654311c.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-c3ef7b4f.entry.js → p-a78616fe.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-ab01f71e.js +1 -0
- package/dist/verdocs-web-sdk/{p-0c0ac290.system.entry.js → p-ac2b339a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-ad11a39a.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-1f561c42.entry.js → p-b1ffa27a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a3c06b62.entry.js → p-bbdafeac.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6a44fb56.system.entry.js → p-bcda78a9.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-afa1f20b.system.entry.js → p-bf850bb9.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f0db17e6.system.entry.js → p-c0635249.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e727af9c.system.entry.js → p-c4c8af4c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-380efff2.system.entry.js → p-c7dbe82b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f483cd49.entry.js → p-ca57cd6e.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-13959c36.system.entry.js → p-d09a9e1b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e72c075e.entry.js → p-d146b48e.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-fa6b1145.system.js → p-d21e9e04.system.js} +2 -2
- package/dist/verdocs-web-sdk/{p-44ec0583.entry.js → p-d763dac2.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-fcfd3193.system.entry.js → p-df439631.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-49b3ac56.entry.js → p-dfbf689b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7850f739.system.entry.js → p-e5365d23.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a4cbba4a.entry.js → p-e702cf26.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7ac080d6.entry.js → p-ededd783.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6e62e65a.entry.js → p-f61f02a7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0b4ea5f9.js → p-ff662b13.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/ipc-test.cjs.entry.js +0 -37
- package/dist/cjs/verdocs-radio-button.cjs.entry.js +0 -23
- package/dist/cjs/verdocs-template-attachments_2.cjs.entry.js +0 -236
- package/dist/collection/components/other/ipctest/ipc-test.css +0 -4
- package/dist/collection/components/other/ipctest/ipc-test.js +0 -79
- package/dist/collection/components/other/ipctest/ipc-test.stories.js +0 -8
- package/dist/components/ipc-test.d.ts +0 -11
- package/dist/components/ipc-test.js +0 -142
- package/dist/esm/ipc-test.entry.js +0 -33
- package/dist/esm/verdocs-radio-button.entry.js +0 -19
- package/dist/esm/verdocs-template-attachments_2.entry.js +0 -231
- package/dist/esm-es5/index-914ed6f7.js +0 -1
- package/dist/esm-es5/ipc-test.entry.js +0 -1
- package/dist/esm-es5/verdocs-radio-button.entry.js +0 -1
- package/dist/esm-es5/verdocs-template-attachments_2.entry.js +0 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +0 -1
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +0 -1
- package/dist/types/components/other/ipctest/ipc-test.d.ts +0 -17
- package/dist/types/components/other/ipctest/ipc-test.stories.d.ts +0 -4
- package/dist/verdocs-web-sdk/p-52428dff.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-58bb657b.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-66f9132c.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-70b42a9c.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-8c5ffa7b.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a6e5814e.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-acaf51f7.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-c220af42.js +0 -1
- package/dist/verdocs-web-sdk/p-d4c8f358.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-daf19924.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-dc9c4361.system.js +0 -1
- package/dist/verdocs-web-sdk/p-decf6a56.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f2b225b7.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f9c6fa6c.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-fdc4e659.entry.js +0 -1
- package/dist/cjs/{VerdocsEndpoint-f2af9468.js → VerdocsEndpoint-e6517a50.js} +30 -30
- package/dist/esm/{VerdocsEndpoint-5b92f115.js → VerdocsEndpoint-6d7a17ce.js} +30 -30
@@ -1,23 +1,16 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
function _typeof(obj) {
|
4
|
-
"@babel/helpers - typeof";
|
5
|
-
|
6
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
7
|
-
return typeof obj;
|
8
|
-
} : function (obj) {
|
9
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
10
|
-
}, _typeof(obj);
|
11
|
-
}
|
12
|
-
|
13
3
|
function toInteger(dirtyNumber) {
|
14
4
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
15
5
|
return NaN;
|
16
6
|
}
|
7
|
+
|
17
8
|
var number = Number(dirtyNumber);
|
9
|
+
|
18
10
|
if (isNaN(number)) {
|
19
11
|
return number;
|
20
12
|
}
|
13
|
+
|
21
14
|
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
22
15
|
}
|
23
16
|
|
@@ -27,6 +20,7 @@ function requiredArgs(required, args) {
|
|
27
20
|
}
|
28
21
|
}
|
29
22
|
|
23
|
+
function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
|
30
24
|
/**
|
31
25
|
* @name toDate
|
32
26
|
* @category Common Helpers
|
@@ -57,12 +51,12 @@ function requiredArgs(required, args) {
|
|
57
51
|
* const result = toDate(1392098430000)
|
58
52
|
* //=> Tue Feb 11 2014 11:30:30
|
59
53
|
*/
|
54
|
+
|
60
55
|
function toDate(argument) {
|
61
56
|
requiredArgs(1, arguments);
|
62
|
-
var argStr = Object.prototype.toString.call(argument);
|
57
|
+
var argStr = Object.prototype.toString.call(argument); // Clone the date
|
63
58
|
|
64
|
-
|
65
|
-
if (argument instanceof Date || _typeof(argument) === 'object' && argStr === '[object Date]') {
|
59
|
+
if (argument instanceof Date || _typeof$1(argument) === 'object' && argStr === '[object Date]') {
|
66
60
|
// Prevent the date to lose the milliseconds when passed to new Date() in IE10
|
67
61
|
return new Date(argument.getTime());
|
68
62
|
} else if (typeof argument === 'number' || argStr === '[object Number]') {
|
@@ -70,10 +64,11 @@ function toDate(argument) {
|
|
70
64
|
} else {
|
71
65
|
if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
|
72
66
|
// eslint-disable-next-line no-console
|
73
|
-
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
|
74
|
-
|
67
|
+
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); // eslint-disable-next-line no-console
|
68
|
+
|
75
69
|
console.warn(new Error().stack);
|
76
70
|
}
|
71
|
+
|
77
72
|
return new Date(NaN);
|
78
73
|
}
|
79
74
|
}
|
@@ -96,6 +91,7 @@ function toDate(argument) {
|
|
96
91
|
* const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
97
92
|
* //=> Thu Jul 10 2014 12:45:30.750
|
98
93
|
*/
|
94
|
+
|
99
95
|
function addMilliseconds(dirtyDate, dirtyAmount) {
|
100
96
|
requiredArgs(2, arguments);
|
101
97
|
var timestamp = toDate(dirtyDate).getTime();
|
@@ -125,6 +121,7 @@ function getTimezoneOffsetInMilliseconds(date) {
|
|
125
121
|
return date.getTime() - utcDate.getTime();
|
126
122
|
}
|
127
123
|
|
124
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
128
125
|
/**
|
129
126
|
* @name isDate
|
130
127
|
* @category Common Helpers
|
@@ -157,6 +154,7 @@ function getTimezoneOffsetInMilliseconds(date) {
|
|
157
154
|
* const result = isDate({})
|
158
155
|
* //=> false
|
159
156
|
*/
|
157
|
+
|
160
158
|
function isDate(value) {
|
161
159
|
requiredArgs(1, arguments);
|
162
160
|
return value instanceof Date || _typeof(value) === 'object' && Object.prototype.toString.call(value) === '[object Date]';
|
@@ -193,11 +191,14 @@ function isDate(value) {
|
|
193
191
|
* const result = isValid(new Date(''))
|
194
192
|
* //=> false
|
195
193
|
*/
|
194
|
+
|
196
195
|
function isValid(dirtyDate) {
|
197
196
|
requiredArgs(1, arguments);
|
197
|
+
|
198
198
|
if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
|
199
199
|
return false;
|
200
200
|
}
|
201
|
+
|
201
202
|
var date = toDate(dirtyDate);
|
202
203
|
return !isNaN(Number(date));
|
203
204
|
}
|
@@ -220,6 +221,7 @@ function isValid(dirtyDate) {
|
|
220
221
|
* const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
|
221
222
|
* //=> Thu Jul 10 2014 12:45:29.250
|
222
223
|
*/
|
224
|
+
|
223
225
|
function subMilliseconds(dirtyDate, dirtyAmount) {
|
224
226
|
requiredArgs(2, arguments);
|
225
227
|
var amount = toInteger(dirtyAmount);
|
@@ -261,6 +263,7 @@ function getUTCISOWeekYear(dirtyDate) {
|
|
261
263
|
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
|
262
264
|
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
|
263
265
|
var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
|
266
|
+
|
264
267
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
265
268
|
return year + 1;
|
266
269
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
@@ -284,24 +287,24 @@ var MILLISECONDS_IN_WEEK$1 = 604800000;
|
|
284
287
|
function getUTCISOWeek(dirtyDate) {
|
285
288
|
requiredArgs(1, arguments);
|
286
289
|
var date = toDate(dirtyDate);
|
287
|
-
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
|
288
|
-
|
289
|
-
// Round the number of days to the nearest integer
|
290
|
+
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
|
290
291
|
// because the number of milliseconds in a week is not constant
|
291
292
|
// (e.g. it's different in the week of the daylight saving time clock shift)
|
293
|
+
|
292
294
|
return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
|
293
295
|
}
|
294
296
|
|
295
297
|
function startOfUTCWeek(dirtyDate, options) {
|
296
298
|
var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
299
|
+
|
297
300
|
requiredArgs(1, arguments);
|
298
301
|
var defaultOptions = getDefaultOptions();
|
299
|
-
var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0);
|
302
|
+
var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
300
303
|
|
301
|
-
// Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
302
304
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
303
305
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
304
306
|
}
|
307
|
+
|
305
308
|
var date = toDate(dirtyDate);
|
306
309
|
var day = date.getUTCDay();
|
307
310
|
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
@@ -312,16 +315,17 @@ function startOfUTCWeek(dirtyDate, options) {
|
|
312
315
|
|
313
316
|
function getUTCWeekYear(dirtyDate, options) {
|
314
317
|
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
318
|
+
|
315
319
|
requiredArgs(1, arguments);
|
316
320
|
var date = toDate(dirtyDate);
|
317
321
|
var year = date.getUTCFullYear();
|
318
322
|
var defaultOptions = getDefaultOptions();
|
319
|
-
var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
|
323
|
+
var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
320
324
|
|
321
|
-
// Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
322
325
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
323
326
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
324
327
|
}
|
328
|
+
|
325
329
|
var firstWeekOfNextYear = new Date(0);
|
326
330
|
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
|
327
331
|
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
|
@@ -330,6 +334,7 @@ function getUTCWeekYear(dirtyDate, options) {
|
|
330
334
|
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
|
331
335
|
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
|
332
336
|
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
|
337
|
+
|
333
338
|
if (date.getTime() >= startOfNextYear.getTime()) {
|
334
339
|
return year + 1;
|
335
340
|
} else if (date.getTime() >= startOfThisYear.getTime()) {
|
@@ -341,6 +346,7 @@ function getUTCWeekYear(dirtyDate, options) {
|
|
341
346
|
|
342
347
|
function startOfUTCWeekYear(dirtyDate, options) {
|
343
348
|
var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
|
349
|
+
|
344
350
|
requiredArgs(1, arguments);
|
345
351
|
var defaultOptions = getDefaultOptions();
|
346
352
|
var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
|
@@ -356,20 +362,21 @@ var MILLISECONDS_IN_WEEK = 604800000;
|
|
356
362
|
function getUTCWeek(dirtyDate, options) {
|
357
363
|
requiredArgs(1, arguments);
|
358
364
|
var date = toDate(dirtyDate);
|
359
|
-
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
|
360
|
-
|
361
|
-
// Round the number of days to the nearest integer
|
365
|
+
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
|
362
366
|
// because the number of milliseconds in a week is not constant
|
363
367
|
// (e.g. it's different in the week of the daylight saving time clock shift)
|
368
|
+
|
364
369
|
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
|
365
370
|
}
|
366
371
|
|
367
372
|
function addLeadingZeros(number, targetLength) {
|
368
373
|
var sign = number < 0 ? '-' : '';
|
369
374
|
var output = Math.abs(number).toString();
|
375
|
+
|
370
376
|
while (output.length < targetLength) {
|
371
377
|
output = '0' + output;
|
372
378
|
}
|
379
|
+
|
373
380
|
return sign + output;
|
374
381
|
}
|
375
382
|
|
@@ -385,6 +392,7 @@ function addLeadingZeros(number, targetLength) {
|
|
385
392
|
*
|
386
393
|
* Letters marked by * are not implemented but reserved by Unicode standard.
|
387
394
|
*/
|
395
|
+
|
388
396
|
var formatters$1 = {
|
389
397
|
// Year
|
390
398
|
y: function y(date, token) {
|
@@ -396,9 +404,8 @@ var formatters$1 = {
|
|
396
404
|
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
|
397
405
|
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
|
398
406
|
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
|
407
|
+
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
399
408
|
|
400
|
-
var signedYear = date.getUTCFullYear();
|
401
|
-
// Returns 1 for 1 BC (which is year 0 in JavaScript)
|
402
409
|
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
403
410
|
return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
|
404
411
|
},
|
@@ -414,14 +421,18 @@ var formatters$1 = {
|
|
414
421
|
// AM or PM
|
415
422
|
a: function a(date, token) {
|
416
423
|
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
|
424
|
+
|
417
425
|
switch (token) {
|
418
426
|
case 'a':
|
419
427
|
case 'aa':
|
420
428
|
return dayPeriodEnumValue.toUpperCase();
|
429
|
+
|
421
430
|
case 'aaa':
|
422
431
|
return dayPeriodEnumValue;
|
432
|
+
|
423
433
|
case 'aaaaa':
|
424
434
|
return dayPeriodEnumValue[0];
|
435
|
+
|
425
436
|
case 'aaaa':
|
426
437
|
default:
|
427
438
|
return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
|
@@ -462,6 +473,7 @@ var dayPeriodEnum = {
|
|
462
473
|
evening: 'evening',
|
463
474
|
night: 'night'
|
464
475
|
};
|
476
|
+
|
465
477
|
/*
|
466
478
|
* | | Unit | | Unit |
|
467
479
|
* |-----|--------------------------------|-----|--------------------------------|
|
@@ -507,11 +519,11 @@ var dayPeriodEnum = {
|
|
507
519
|
* - `P` is long localized date format
|
508
520
|
* - `p` is long localized time format
|
509
521
|
*/
|
510
|
-
|
511
522
|
var formatters = {
|
512
523
|
// Era
|
513
524
|
G: function G(date, token, localize) {
|
514
525
|
var era = date.getUTCFullYear() > 0 ? 1 : 0;
|
526
|
+
|
515
527
|
switch (token) {
|
516
528
|
// AD, BC
|
517
529
|
case 'G':
|
@@ -521,11 +533,13 @@ var formatters = {
|
|
521
533
|
width: 'abbreviated'
|
522
534
|
});
|
523
535
|
// A, B
|
536
|
+
|
524
537
|
case 'GGGGG':
|
525
538
|
return localize.era(era, {
|
526
539
|
width: 'narrow'
|
527
540
|
});
|
528
541
|
// Anno Domini, Before Christ
|
542
|
+
|
529
543
|
case 'GGGG':
|
530
544
|
default:
|
531
545
|
return localize.era(era, {
|
@@ -537,42 +551,41 @@ var formatters = {
|
|
537
551
|
y: function y(date, token, localize) {
|
538
552
|
// Ordinal number
|
539
553
|
if (token === 'yo') {
|
540
|
-
var signedYear = date.getUTCFullYear();
|
541
|
-
|
554
|
+
var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
555
|
+
|
542
556
|
var year = signedYear > 0 ? signedYear : 1 - signedYear;
|
543
557
|
return localize.ordinalNumber(year, {
|
544
558
|
unit: 'year'
|
545
559
|
});
|
546
560
|
}
|
561
|
+
|
547
562
|
return formatters$1.y(date, token);
|
548
563
|
},
|
549
564
|
// Local week-numbering year
|
550
565
|
Y: function Y(date, token, localize, options) {
|
551
|
-
var signedWeekYear = getUTCWeekYear(date, options);
|
552
|
-
|
553
|
-
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
566
|
+
var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
|
567
|
+
|
568
|
+
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
|
554
569
|
|
555
|
-
// Two digit year
|
556
570
|
if (token === 'YY') {
|
557
571
|
var twoDigitYear = weekYear % 100;
|
558
572
|
return addLeadingZeros(twoDigitYear, 2);
|
559
|
-
}
|
573
|
+
} // Ordinal number
|
574
|
+
|
560
575
|
|
561
|
-
// Ordinal number
|
562
576
|
if (token === 'Yo') {
|
563
577
|
return localize.ordinalNumber(weekYear, {
|
564
578
|
unit: 'year'
|
565
579
|
});
|
566
|
-
}
|
580
|
+
} // Padding
|
581
|
+
|
567
582
|
|
568
|
-
// Padding
|
569
583
|
return addLeadingZeros(weekYear, token.length);
|
570
584
|
},
|
571
585
|
// ISO week-numbering year
|
572
586
|
R: function R(date, token) {
|
573
|
-
var isoWeekYear = getUTCISOWeekYear(date);
|
587
|
+
var isoWeekYear = getUTCISOWeekYear(date); // Padding
|
574
588
|
|
575
|
-
// Padding
|
576
589
|
return addLeadingZeros(isoWeekYear, token.length);
|
577
590
|
},
|
578
591
|
// Extended year. This is a single number designating the year of this calendar system.
|
@@ -591,31 +604,37 @@ var formatters = {
|
|
591
604
|
// Quarter
|
592
605
|
Q: function Q(date, token, localize) {
|
593
606
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
607
|
+
|
594
608
|
switch (token) {
|
595
609
|
// 1, 2, 3, 4
|
596
610
|
case 'Q':
|
597
611
|
return String(quarter);
|
598
612
|
// 01, 02, 03, 04
|
613
|
+
|
599
614
|
case 'QQ':
|
600
615
|
return addLeadingZeros(quarter, 2);
|
601
616
|
// 1st, 2nd, 3rd, 4th
|
617
|
+
|
602
618
|
case 'Qo':
|
603
619
|
return localize.ordinalNumber(quarter, {
|
604
620
|
unit: 'quarter'
|
605
621
|
});
|
606
622
|
// Q1, Q2, Q3, Q4
|
623
|
+
|
607
624
|
case 'QQQ':
|
608
625
|
return localize.quarter(quarter, {
|
609
626
|
width: 'abbreviated',
|
610
627
|
context: 'formatting'
|
611
628
|
});
|
612
629
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
630
|
+
|
613
631
|
case 'QQQQQ':
|
614
632
|
return localize.quarter(quarter, {
|
615
633
|
width: 'narrow',
|
616
634
|
context: 'formatting'
|
617
635
|
});
|
618
636
|
// 1st quarter, 2nd quarter, ...
|
637
|
+
|
619
638
|
case 'QQQQ':
|
620
639
|
default:
|
621
640
|
return localize.quarter(quarter, {
|
@@ -627,31 +646,37 @@ var formatters = {
|
|
627
646
|
// Stand-alone quarter
|
628
647
|
q: function q(date, token, localize) {
|
629
648
|
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
|
649
|
+
|
630
650
|
switch (token) {
|
631
651
|
// 1, 2, 3, 4
|
632
652
|
case 'q':
|
633
653
|
return String(quarter);
|
634
654
|
// 01, 02, 03, 04
|
655
|
+
|
635
656
|
case 'qq':
|
636
657
|
return addLeadingZeros(quarter, 2);
|
637
658
|
// 1st, 2nd, 3rd, 4th
|
659
|
+
|
638
660
|
case 'qo':
|
639
661
|
return localize.ordinalNumber(quarter, {
|
640
662
|
unit: 'quarter'
|
641
663
|
});
|
642
664
|
// Q1, Q2, Q3, Q4
|
665
|
+
|
643
666
|
case 'qqq':
|
644
667
|
return localize.quarter(quarter, {
|
645
668
|
width: 'abbreviated',
|
646
669
|
context: 'standalone'
|
647
670
|
});
|
648
671
|
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
672
|
+
|
649
673
|
case 'qqqqq':
|
650
674
|
return localize.quarter(quarter, {
|
651
675
|
width: 'narrow',
|
652
676
|
context: 'standalone'
|
653
677
|
});
|
654
678
|
// 1st quarter, 2nd quarter, ...
|
679
|
+
|
655
680
|
case 'qqqq':
|
656
681
|
default:
|
657
682
|
return localize.quarter(quarter, {
|
@@ -663,28 +688,33 @@ var formatters = {
|
|
663
688
|
// Month
|
664
689
|
M: function M(date, token, localize) {
|
665
690
|
var month = date.getUTCMonth();
|
691
|
+
|
666
692
|
switch (token) {
|
667
693
|
case 'M':
|
668
694
|
case 'MM':
|
669
695
|
return formatters$1.M(date, token);
|
670
696
|
// 1st, 2nd, ..., 12th
|
697
|
+
|
671
698
|
case 'Mo':
|
672
699
|
return localize.ordinalNumber(month + 1, {
|
673
700
|
unit: 'month'
|
674
701
|
});
|
675
702
|
// Jan, Feb, ..., Dec
|
703
|
+
|
676
704
|
case 'MMM':
|
677
705
|
return localize.month(month, {
|
678
706
|
width: 'abbreviated',
|
679
707
|
context: 'formatting'
|
680
708
|
});
|
681
709
|
// J, F, ..., D
|
710
|
+
|
682
711
|
case 'MMMMM':
|
683
712
|
return localize.month(month, {
|
684
713
|
width: 'narrow',
|
685
714
|
context: 'formatting'
|
686
715
|
});
|
687
716
|
// January, February, ..., December
|
717
|
+
|
688
718
|
case 'MMMM':
|
689
719
|
default:
|
690
720
|
return localize.month(month, {
|
@@ -696,31 +726,37 @@ var formatters = {
|
|
696
726
|
// Stand-alone month
|
697
727
|
L: function L(date, token, localize) {
|
698
728
|
var month = date.getUTCMonth();
|
729
|
+
|
699
730
|
switch (token) {
|
700
731
|
// 1, 2, ..., 12
|
701
732
|
case 'L':
|
702
733
|
return String(month + 1);
|
703
734
|
// 01, 02, ..., 12
|
735
|
+
|
704
736
|
case 'LL':
|
705
737
|
return addLeadingZeros(month + 1, 2);
|
706
738
|
// 1st, 2nd, ..., 12th
|
739
|
+
|
707
740
|
case 'Lo':
|
708
741
|
return localize.ordinalNumber(month + 1, {
|
709
742
|
unit: 'month'
|
710
743
|
});
|
711
744
|
// Jan, Feb, ..., Dec
|
745
|
+
|
712
746
|
case 'LLL':
|
713
747
|
return localize.month(month, {
|
714
748
|
width: 'abbreviated',
|
715
749
|
context: 'standalone'
|
716
750
|
});
|
717
751
|
// J, F, ..., D
|
752
|
+
|
718
753
|
case 'LLLLL':
|
719
754
|
return localize.month(month, {
|
720
755
|
width: 'narrow',
|
721
756
|
context: 'standalone'
|
722
757
|
});
|
723
758
|
// January, February, ..., December
|
759
|
+
|
724
760
|
case 'LLLL':
|
725
761
|
default:
|
726
762
|
return localize.month(month, {
|
@@ -732,21 +768,25 @@ var formatters = {
|
|
732
768
|
// Local week of year
|
733
769
|
w: function w(date, token, localize, options) {
|
734
770
|
var week = getUTCWeek(date, options);
|
771
|
+
|
735
772
|
if (token === 'wo') {
|
736
773
|
return localize.ordinalNumber(week, {
|
737
774
|
unit: 'week'
|
738
775
|
});
|
739
776
|
}
|
777
|
+
|
740
778
|
return addLeadingZeros(week, token.length);
|
741
779
|
},
|
742
780
|
// ISO week of year
|
743
781
|
I: function I(date, token, localize) {
|
744
782
|
var isoWeek = getUTCISOWeek(date);
|
783
|
+
|
745
784
|
if (token === 'Io') {
|
746
785
|
return localize.ordinalNumber(isoWeek, {
|
747
786
|
unit: 'week'
|
748
787
|
});
|
749
788
|
}
|
789
|
+
|
750
790
|
return addLeadingZeros(isoWeek, token.length);
|
751
791
|
},
|
752
792
|
// Day of the month
|
@@ -756,21 +796,25 @@ var formatters = {
|
|
756
796
|
unit: 'date'
|
757
797
|
});
|
758
798
|
}
|
799
|
+
|
759
800
|
return formatters$1.d(date, token);
|
760
801
|
},
|
761
802
|
// Day of year
|
762
803
|
D: function D(date, token, localize) {
|
763
804
|
var dayOfYear = getUTCDayOfYear(date);
|
805
|
+
|
764
806
|
if (token === 'Do') {
|
765
807
|
return localize.ordinalNumber(dayOfYear, {
|
766
808
|
unit: 'dayOfYear'
|
767
809
|
});
|
768
810
|
}
|
811
|
+
|
769
812
|
return addLeadingZeros(dayOfYear, token.length);
|
770
813
|
},
|
771
814
|
// Day of week
|
772
815
|
E: function E(date, token, localize) {
|
773
816
|
var dayOfWeek = date.getUTCDay();
|
817
|
+
|
774
818
|
switch (token) {
|
775
819
|
// Tue
|
776
820
|
case 'E':
|
@@ -781,18 +825,21 @@ var formatters = {
|
|
781
825
|
context: 'formatting'
|
782
826
|
});
|
783
827
|
// T
|
828
|
+
|
784
829
|
case 'EEEEE':
|
785
830
|
return localize.day(dayOfWeek, {
|
786
831
|
width: 'narrow',
|
787
832
|
context: 'formatting'
|
788
833
|
});
|
789
834
|
// Tu
|
835
|
+
|
790
836
|
case 'EEEEEE':
|
791
837
|
return localize.day(dayOfWeek, {
|
792
838
|
width: 'short',
|
793
839
|
context: 'formatting'
|
794
840
|
});
|
795
841
|
// Tuesday
|
842
|
+
|
796
843
|
case 'EEEE':
|
797
844
|
default:
|
798
845
|
return localize.day(dayOfWeek, {
|
@@ -805,36 +852,43 @@ var formatters = {
|
|
805
852
|
e: function e(date, token, localize, options) {
|
806
853
|
var dayOfWeek = date.getUTCDay();
|
807
854
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
855
|
+
|
808
856
|
switch (token) {
|
809
857
|
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
810
858
|
case 'e':
|
811
859
|
return String(localDayOfWeek);
|
812
860
|
// Padded numerical value
|
861
|
+
|
813
862
|
case 'ee':
|
814
863
|
return addLeadingZeros(localDayOfWeek, 2);
|
815
864
|
// 1st, 2nd, ..., 7th
|
865
|
+
|
816
866
|
case 'eo':
|
817
867
|
return localize.ordinalNumber(localDayOfWeek, {
|
818
868
|
unit: 'day'
|
819
869
|
});
|
870
|
+
|
820
871
|
case 'eee':
|
821
872
|
return localize.day(dayOfWeek, {
|
822
873
|
width: 'abbreviated',
|
823
874
|
context: 'formatting'
|
824
875
|
});
|
825
876
|
// T
|
877
|
+
|
826
878
|
case 'eeeee':
|
827
879
|
return localize.day(dayOfWeek, {
|
828
880
|
width: 'narrow',
|
829
881
|
context: 'formatting'
|
830
882
|
});
|
831
883
|
// Tu
|
884
|
+
|
832
885
|
case 'eeeeee':
|
833
886
|
return localize.day(dayOfWeek, {
|
834
887
|
width: 'short',
|
835
888
|
context: 'formatting'
|
836
889
|
});
|
837
890
|
// Tuesday
|
891
|
+
|
838
892
|
case 'eeee':
|
839
893
|
default:
|
840
894
|
return localize.day(dayOfWeek, {
|
@@ -847,36 +901,43 @@ var formatters = {
|
|
847
901
|
c: function c(date, token, localize, options) {
|
848
902
|
var dayOfWeek = date.getUTCDay();
|
849
903
|
var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
904
|
+
|
850
905
|
switch (token) {
|
851
906
|
// Numerical value (same as in `e`)
|
852
907
|
case 'c':
|
853
908
|
return String(localDayOfWeek);
|
854
909
|
// Padded numerical value
|
910
|
+
|
855
911
|
case 'cc':
|
856
912
|
return addLeadingZeros(localDayOfWeek, token.length);
|
857
913
|
// 1st, 2nd, ..., 7th
|
914
|
+
|
858
915
|
case 'co':
|
859
916
|
return localize.ordinalNumber(localDayOfWeek, {
|
860
917
|
unit: 'day'
|
861
918
|
});
|
919
|
+
|
862
920
|
case 'ccc':
|
863
921
|
return localize.day(dayOfWeek, {
|
864
922
|
width: 'abbreviated',
|
865
923
|
context: 'standalone'
|
866
924
|
});
|
867
925
|
// T
|
926
|
+
|
868
927
|
case 'ccccc':
|
869
928
|
return localize.day(dayOfWeek, {
|
870
929
|
width: 'narrow',
|
871
930
|
context: 'standalone'
|
872
931
|
});
|
873
932
|
// Tu
|
933
|
+
|
874
934
|
case 'cccccc':
|
875
935
|
return localize.day(dayOfWeek, {
|
876
936
|
width: 'short',
|
877
937
|
context: 'standalone'
|
878
938
|
});
|
879
939
|
// Tuesday
|
940
|
+
|
880
941
|
case 'cccc':
|
881
942
|
default:
|
882
943
|
return localize.day(dayOfWeek, {
|
@@ -889,37 +950,44 @@ var formatters = {
|
|
889
950
|
i: function i(date, token, localize) {
|
890
951
|
var dayOfWeek = date.getUTCDay();
|
891
952
|
var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
953
|
+
|
892
954
|
switch (token) {
|
893
955
|
// 2
|
894
956
|
case 'i':
|
895
957
|
return String(isoDayOfWeek);
|
896
958
|
// 02
|
959
|
+
|
897
960
|
case 'ii':
|
898
961
|
return addLeadingZeros(isoDayOfWeek, token.length);
|
899
962
|
// 2nd
|
963
|
+
|
900
964
|
case 'io':
|
901
965
|
return localize.ordinalNumber(isoDayOfWeek, {
|
902
966
|
unit: 'day'
|
903
967
|
});
|
904
968
|
// Tue
|
969
|
+
|
905
970
|
case 'iii':
|
906
971
|
return localize.day(dayOfWeek, {
|
907
972
|
width: 'abbreviated',
|
908
973
|
context: 'formatting'
|
909
974
|
});
|
910
975
|
// T
|
976
|
+
|
911
977
|
case 'iiiii':
|
912
978
|
return localize.day(dayOfWeek, {
|
913
979
|
width: 'narrow',
|
914
980
|
context: 'formatting'
|
915
981
|
});
|
916
982
|
// Tu
|
983
|
+
|
917
984
|
case 'iiiiii':
|
918
985
|
return localize.day(dayOfWeek, {
|
919
986
|
width: 'short',
|
920
987
|
context: 'formatting'
|
921
988
|
});
|
922
989
|
// Tuesday
|
990
|
+
|
923
991
|
case 'iiii':
|
924
992
|
default:
|
925
993
|
return localize.day(dayOfWeek, {
|
@@ -932,6 +1000,7 @@ var formatters = {
|
|
932
1000
|
a: function a(date, token, localize) {
|
933
1001
|
var hours = date.getUTCHours();
|
934
1002
|
var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
1003
|
+
|
935
1004
|
switch (token) {
|
936
1005
|
case 'a':
|
937
1006
|
case 'aa':
|
@@ -939,16 +1008,19 @@ var formatters = {
|
|
939
1008
|
width: 'abbreviated',
|
940
1009
|
context: 'formatting'
|
941
1010
|
});
|
1011
|
+
|
942
1012
|
case 'aaa':
|
943
1013
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
944
1014
|
width: 'abbreviated',
|
945
1015
|
context: 'formatting'
|
946
1016
|
}).toLowerCase();
|
1017
|
+
|
947
1018
|
case 'aaaaa':
|
948
1019
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
949
1020
|
width: 'narrow',
|
950
1021
|
context: 'formatting'
|
951
1022
|
});
|
1023
|
+
|
952
1024
|
case 'aaaa':
|
953
1025
|
default:
|
954
1026
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
@@ -961,6 +1033,7 @@ var formatters = {
|
|
961
1033
|
b: function b(date, token, localize) {
|
962
1034
|
var hours = date.getUTCHours();
|
963
1035
|
var dayPeriodEnumValue;
|
1036
|
+
|
964
1037
|
if (hours === 12) {
|
965
1038
|
dayPeriodEnumValue = dayPeriodEnum.noon;
|
966
1039
|
} else if (hours === 0) {
|
@@ -968,6 +1041,7 @@ var formatters = {
|
|
968
1041
|
} else {
|
969
1042
|
dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
|
970
1043
|
}
|
1044
|
+
|
971
1045
|
switch (token) {
|
972
1046
|
case 'b':
|
973
1047
|
case 'bb':
|
@@ -975,16 +1049,19 @@ var formatters = {
|
|
975
1049
|
width: 'abbreviated',
|
976
1050
|
context: 'formatting'
|
977
1051
|
});
|
1052
|
+
|
978
1053
|
case 'bbb':
|
979
1054
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
980
1055
|
width: 'abbreviated',
|
981
1056
|
context: 'formatting'
|
982
1057
|
}).toLowerCase();
|
1058
|
+
|
983
1059
|
case 'bbbbb':
|
984
1060
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
985
1061
|
width: 'narrow',
|
986
1062
|
context: 'formatting'
|
987
1063
|
});
|
1064
|
+
|
988
1065
|
case 'bbbb':
|
989
1066
|
default:
|
990
1067
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
@@ -997,6 +1074,7 @@ var formatters = {
|
|
997
1074
|
B: function B(date, token, localize) {
|
998
1075
|
var hours = date.getUTCHours();
|
999
1076
|
var dayPeriodEnumValue;
|
1077
|
+
|
1000
1078
|
if (hours >= 17) {
|
1001
1079
|
dayPeriodEnumValue = dayPeriodEnum.evening;
|
1002
1080
|
} else if (hours >= 12) {
|
@@ -1006,6 +1084,7 @@ var formatters = {
|
|
1006
1084
|
} else {
|
1007
1085
|
dayPeriodEnumValue = dayPeriodEnum.night;
|
1008
1086
|
}
|
1087
|
+
|
1009
1088
|
switch (token) {
|
1010
1089
|
case 'B':
|
1011
1090
|
case 'BB':
|
@@ -1014,11 +1093,13 @@ var formatters = {
|
|
1014
1093
|
width: 'abbreviated',
|
1015
1094
|
context: 'formatting'
|
1016
1095
|
});
|
1096
|
+
|
1017
1097
|
case 'BBBBB':
|
1018
1098
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
1019
1099
|
width: 'narrow',
|
1020
1100
|
context: 'formatting'
|
1021
1101
|
});
|
1102
|
+
|
1022
1103
|
case 'BBBB':
|
1023
1104
|
default:
|
1024
1105
|
return localize.dayPeriod(dayPeriodEnumValue, {
|
@@ -1036,6 +1117,7 @@ var formatters = {
|
|
1036
1117
|
unit: 'hour'
|
1037
1118
|
});
|
1038
1119
|
}
|
1120
|
+
|
1039
1121
|
return formatters$1.h(date, token);
|
1040
1122
|
},
|
1041
1123
|
// Hour [0-23]
|
@@ -1045,27 +1127,32 @@ var formatters = {
|
|
1045
1127
|
unit: 'hour'
|
1046
1128
|
});
|
1047
1129
|
}
|
1130
|
+
|
1048
1131
|
return formatters$1.H(date, token);
|
1049
1132
|
},
|
1050
1133
|
// Hour [0-11]
|
1051
1134
|
K: function K(date, token, localize) {
|
1052
1135
|
var hours = date.getUTCHours() % 12;
|
1136
|
+
|
1053
1137
|
if (token === 'Ko') {
|
1054
1138
|
return localize.ordinalNumber(hours, {
|
1055
1139
|
unit: 'hour'
|
1056
1140
|
});
|
1057
1141
|
}
|
1142
|
+
|
1058
1143
|
return addLeadingZeros(hours, token.length);
|
1059
1144
|
},
|
1060
1145
|
// Hour [1-24]
|
1061
1146
|
k: function k(date, token, localize) {
|
1062
1147
|
var hours = date.getUTCHours();
|
1063
1148
|
if (hours === 0) hours = 24;
|
1149
|
+
|
1064
1150
|
if (token === 'ko') {
|
1065
1151
|
return localize.ordinalNumber(hours, {
|
1066
1152
|
unit: 'hour'
|
1067
1153
|
});
|
1068
1154
|
}
|
1155
|
+
|
1069
1156
|
return addLeadingZeros(hours, token.length);
|
1070
1157
|
},
|
1071
1158
|
// Minute
|
@@ -1075,6 +1162,7 @@ var formatters = {
|
|
1075
1162
|
unit: 'minute'
|
1076
1163
|
});
|
1077
1164
|
}
|
1165
|
+
|
1078
1166
|
return formatters$1.m(date, token);
|
1079
1167
|
},
|
1080
1168
|
// Second
|
@@ -1084,6 +1172,7 @@ var formatters = {
|
|
1084
1172
|
unit: 'second'
|
1085
1173
|
});
|
1086
1174
|
}
|
1175
|
+
|
1087
1176
|
return formatters$1.s(date, token);
|
1088
1177
|
},
|
1089
1178
|
// Fraction of second
|
@@ -1094,27 +1183,30 @@ var formatters = {
|
|
1094
1183
|
X: function X(date, token, _localize, options) {
|
1095
1184
|
var originalDate = options._originalDate || date;
|
1096
1185
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
1186
|
+
|
1097
1187
|
if (timezoneOffset === 0) {
|
1098
1188
|
return 'Z';
|
1099
1189
|
}
|
1190
|
+
|
1100
1191
|
switch (token) {
|
1101
1192
|
// Hours and optional minutes
|
1102
1193
|
case 'X':
|
1103
1194
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
1104
|
-
|
1105
1195
|
// Hours, minutes and optional seconds without `:` delimiter
|
1106
1196
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
1107
1197
|
// so this token always has the same output as `XX`
|
1198
|
+
|
1108
1199
|
case 'XXXX':
|
1109
1200
|
case 'XX':
|
1110
1201
|
// Hours and minutes without `:` delimiter
|
1111
1202
|
return formatTimezone(timezoneOffset);
|
1112
|
-
|
1113
1203
|
// Hours, minutes and optional seconds with `:` delimiter
|
1114
1204
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
1115
1205
|
// so this token always has the same output as `XXX`
|
1206
|
+
|
1116
1207
|
case 'XXXXX':
|
1117
1208
|
case 'XXX': // Hours and minutes with `:` delimiter
|
1209
|
+
|
1118
1210
|
default:
|
1119
1211
|
return formatTimezone(timezoneOffset, ':');
|
1120
1212
|
}
|
@@ -1123,24 +1215,26 @@ var formatters = {
|
|
1123
1215
|
x: function x(date, token, _localize, options) {
|
1124
1216
|
var originalDate = options._originalDate || date;
|
1125
1217
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
1218
|
+
|
1126
1219
|
switch (token) {
|
1127
1220
|
// Hours and optional minutes
|
1128
1221
|
case 'x':
|
1129
1222
|
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
1130
|
-
|
1131
1223
|
// Hours, minutes and optional seconds without `:` delimiter
|
1132
1224
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
1133
1225
|
// so this token always has the same output as `xx`
|
1226
|
+
|
1134
1227
|
case 'xxxx':
|
1135
1228
|
case 'xx':
|
1136
1229
|
// Hours and minutes without `:` delimiter
|
1137
1230
|
return formatTimezone(timezoneOffset);
|
1138
|
-
|
1139
1231
|
// Hours, minutes and optional seconds with `:` delimiter
|
1140
1232
|
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
1141
1233
|
// so this token always has the same output as `xxx`
|
1234
|
+
|
1142
1235
|
case 'xxxxx':
|
1143
1236
|
case 'xxx': // Hours and minutes with `:` delimiter
|
1237
|
+
|
1144
1238
|
default:
|
1145
1239
|
return formatTimezone(timezoneOffset, ':');
|
1146
1240
|
}
|
@@ -1149,6 +1243,7 @@ var formatters = {
|
|
1149
1243
|
O: function O(date, token, _localize, options) {
|
1150
1244
|
var originalDate = options._originalDate || date;
|
1151
1245
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
1246
|
+
|
1152
1247
|
switch (token) {
|
1153
1248
|
// Short
|
1154
1249
|
case 'O':
|
@@ -1156,6 +1251,7 @@ var formatters = {
|
|
1156
1251
|
case 'OOO':
|
1157
1252
|
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
|
1158
1253
|
// Long
|
1254
|
+
|
1159
1255
|
case 'OOOO':
|
1160
1256
|
default:
|
1161
1257
|
return 'GMT' + formatTimezone(timezoneOffset, ':');
|
@@ -1165,6 +1261,7 @@ var formatters = {
|
|
1165
1261
|
z: function z(date, token, _localize, options) {
|
1166
1262
|
var originalDate = options._originalDate || date;
|
1167
1263
|
var timezoneOffset = originalDate.getTimezoneOffset();
|
1264
|
+
|
1168
1265
|
switch (token) {
|
1169
1266
|
// Short
|
1170
1267
|
case 'z':
|
@@ -1172,6 +1269,7 @@ var formatters = {
|
|
1172
1269
|
case 'zzz':
|
1173
1270
|
return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
|
1174
1271
|
// Long
|
1272
|
+
|
1175
1273
|
case 'zzzz':
|
1176
1274
|
default:
|
1177
1275
|
return 'GMT' + formatTimezone(timezoneOffset, ':');
|
@@ -1190,24 +1288,30 @@ var formatters = {
|
|
1190
1288
|
return addLeadingZeros(timestamp, token.length);
|
1191
1289
|
}
|
1192
1290
|
};
|
1291
|
+
|
1193
1292
|
function formatTimezoneShort(offset, dirtyDelimiter) {
|
1194
1293
|
var sign = offset > 0 ? '-' : '+';
|
1195
1294
|
var absOffset = Math.abs(offset);
|
1196
1295
|
var hours = Math.floor(absOffset / 60);
|
1197
1296
|
var minutes = absOffset % 60;
|
1297
|
+
|
1198
1298
|
if (minutes === 0) {
|
1199
1299
|
return sign + String(hours);
|
1200
1300
|
}
|
1301
|
+
|
1201
1302
|
var delimiter = dirtyDelimiter || '';
|
1202
1303
|
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
1203
1304
|
}
|
1305
|
+
|
1204
1306
|
function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
|
1205
1307
|
if (offset % 60 === 0) {
|
1206
1308
|
var sign = offset > 0 ? '-' : '+';
|
1207
1309
|
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
1208
1310
|
}
|
1311
|
+
|
1209
1312
|
return formatTimezone(offset, dirtyDelimiter);
|
1210
1313
|
}
|
1314
|
+
|
1211
1315
|
function formatTimezone(offset, dirtyDelimiter) {
|
1212
1316
|
var delimiter = dirtyDelimiter || '';
|
1213
1317
|
var sign = offset > 0 ? '-' : '+';
|
@@ -1223,14 +1327,17 @@ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
|
|
1223
1327
|
return formatLong.date({
|
1224
1328
|
width: 'short'
|
1225
1329
|
});
|
1330
|
+
|
1226
1331
|
case 'PP':
|
1227
1332
|
return formatLong.date({
|
1228
1333
|
width: 'medium'
|
1229
1334
|
});
|
1335
|
+
|
1230
1336
|
case 'PPP':
|
1231
1337
|
return formatLong.date({
|
1232
1338
|
width: 'long'
|
1233
1339
|
});
|
1340
|
+
|
1234
1341
|
case 'PPPP':
|
1235
1342
|
default:
|
1236
1343
|
return formatLong.date({
|
@@ -1238,20 +1345,24 @@ var dateLongFormatter = function dateLongFormatter(pattern, formatLong) {
|
|
1238
1345
|
});
|
1239
1346
|
}
|
1240
1347
|
};
|
1348
|
+
|
1241
1349
|
var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
|
1242
1350
|
switch (pattern) {
|
1243
1351
|
case 'p':
|
1244
1352
|
return formatLong.time({
|
1245
1353
|
width: 'short'
|
1246
1354
|
});
|
1355
|
+
|
1247
1356
|
case 'pp':
|
1248
1357
|
return formatLong.time({
|
1249
1358
|
width: 'medium'
|
1250
1359
|
});
|
1360
|
+
|
1251
1361
|
case 'ppp':
|
1252
1362
|
return formatLong.time({
|
1253
1363
|
width: 'long'
|
1254
1364
|
});
|
1365
|
+
|
1255
1366
|
case 'pppp':
|
1256
1367
|
default:
|
1257
1368
|
return formatLong.time({
|
@@ -1259,30 +1370,37 @@ var timeLongFormatter = function timeLongFormatter(pattern, formatLong) {
|
|
1259
1370
|
});
|
1260
1371
|
}
|
1261
1372
|
};
|
1373
|
+
|
1262
1374
|
var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong) {
|
1263
1375
|
var matchResult = pattern.match(/(P+)(p+)?/) || [];
|
1264
1376
|
var datePattern = matchResult[1];
|
1265
1377
|
var timePattern = matchResult[2];
|
1378
|
+
|
1266
1379
|
if (!timePattern) {
|
1267
1380
|
return dateLongFormatter(pattern, formatLong);
|
1268
1381
|
}
|
1382
|
+
|
1269
1383
|
var dateTimeFormat;
|
1384
|
+
|
1270
1385
|
switch (datePattern) {
|
1271
1386
|
case 'P':
|
1272
1387
|
dateTimeFormat = formatLong.dateTime({
|
1273
1388
|
width: 'short'
|
1274
1389
|
});
|
1275
1390
|
break;
|
1391
|
+
|
1276
1392
|
case 'PP':
|
1277
1393
|
dateTimeFormat = formatLong.dateTime({
|
1278
1394
|
width: 'medium'
|
1279
1395
|
});
|
1280
1396
|
break;
|
1397
|
+
|
1281
1398
|
case 'PPP':
|
1282
1399
|
dateTimeFormat = formatLong.dateTime({
|
1283
1400
|
width: 'long'
|
1284
1401
|
});
|
1285
1402
|
break;
|
1403
|
+
|
1286
1404
|
case 'PPPP':
|
1287
1405
|
default:
|
1288
1406
|
dateTimeFormat = formatLong.dateTime({
|
@@ -1290,8 +1408,10 @@ var dateTimeLongFormatter = function dateTimeLongFormatter(pattern, formatLong)
|
|
1290
1408
|
});
|
1291
1409
|
break;
|
1292
1410
|
}
|
1411
|
+
|
1293
1412
|
return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
|
1294
1413
|
};
|
1414
|
+
|
1295
1415
|
var longFormatters = {
|
1296
1416
|
p: timeLongFormatter,
|
1297
1417
|
P: dateTimeLongFormatter
|
@@ -1380,9 +1500,11 @@ var formatDistanceLocale = {
|
|
1380
1500
|
other: 'almost {{count}} years'
|
1381
1501
|
}
|
1382
1502
|
};
|
1503
|
+
|
1383
1504
|
var formatDistance = function formatDistance(token, count, options) {
|
1384
1505
|
var result;
|
1385
1506
|
var tokenValue = formatDistanceLocale[token];
|
1507
|
+
|
1386
1508
|
if (typeof tokenValue === 'string') {
|
1387
1509
|
result = tokenValue;
|
1388
1510
|
} else if (count === 1) {
|
@@ -1390,6 +1512,7 @@ var formatDistance = function formatDistance(token, count, options) {
|
|
1390
1512
|
} else {
|
1391
1513
|
result = tokenValue.other.replace('{{count}}', count.toString());
|
1392
1514
|
}
|
1515
|
+
|
1393
1516
|
if (options !== null && options !== void 0 && options.addSuffix) {
|
1394
1517
|
if (options.comparison && options.comparison > 0) {
|
1395
1518
|
return 'in ' + result;
|
@@ -1397,6 +1520,7 @@ var formatDistance = function formatDistance(token, count, options) {
|
|
1397
1520
|
return result + ' ago';
|
1398
1521
|
}
|
1399
1522
|
}
|
1523
|
+
|
1400
1524
|
return result;
|
1401
1525
|
};
|
1402
1526
|
|
@@ -1451,6 +1575,7 @@ var formatRelativeLocale = {
|
|
1451
1575
|
nextWeek: "eeee 'at' p",
|
1452
1576
|
other: 'P'
|
1453
1577
|
};
|
1578
|
+
|
1454
1579
|
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
|
1455
1580
|
return formatRelativeLocale[token];
|
1456
1581
|
};
|
@@ -1459,17 +1584,21 @@ function buildLocalizeFn(args) {
|
|
1459
1584
|
return function (dirtyIndex, options) {
|
1460
1585
|
var context = options !== null && options !== void 0 && options.context ? String(options.context) : 'standalone';
|
1461
1586
|
var valuesArray;
|
1587
|
+
|
1462
1588
|
if (context === 'formatting' && args.formattingValues) {
|
1463
1589
|
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
1464
1590
|
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
|
1465
1591
|
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
1466
1592
|
} else {
|
1467
1593
|
var _defaultWidth = args.defaultWidth;
|
1594
|
+
|
1468
1595
|
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
|
1596
|
+
|
1469
1597
|
valuesArray = args.values[_width] || args.values[_defaultWidth];
|
1470
1598
|
}
|
1471
|
-
|
1472
|
-
// @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
|
1599
|
+
|
1600
|
+
var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
|
1601
|
+
|
1473
1602
|
return valuesArray[index];
|
1474
1603
|
};
|
1475
1604
|
}
|
@@ -1483,12 +1612,11 @@ var quarterValues = {
|
|
1483
1612
|
narrow: ['1', '2', '3', '4'],
|
1484
1613
|
abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
|
1485
1614
|
wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
|
1486
|
-
};
|
1487
|
-
|
1488
|
-
// Note: in English, the names of days of the week and months are capitalized.
|
1615
|
+
}; // Note: in English, the names of days of the week and months are capitalized.
|
1489
1616
|
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
|
1490
1617
|
// Generally, formatted dates should look like they are in the middle of a sentence,
|
1491
1618
|
// e.g. in Spanish language the weekdays and months should be in the lowercase.
|
1619
|
+
|
1492
1620
|
var monthValues = {
|
1493
1621
|
narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
|
1494
1622
|
abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
@@ -1564,10 +1692,9 @@ var formattingDayPeriodValues = {
|
|
1564
1692
|
night: 'at night'
|
1565
1693
|
}
|
1566
1694
|
};
|
1567
|
-
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
|
1568
|
-
var number = Number(dirtyNumber);
|
1569
1695
|
|
1570
|
-
|
1696
|
+
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
|
1697
|
+
var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
|
1571
1698
|
// if they are different for different grammatical genders,
|
1572
1699
|
// use `options.unit`.
|
1573
1700
|
//
|
@@ -1575,18 +1702,23 @@ var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
|
|
1575
1702
|
// 'day', 'hour', 'minute', 'second'.
|
1576
1703
|
|
1577
1704
|
var rem100 = number % 100;
|
1705
|
+
|
1578
1706
|
if (rem100 > 20 || rem100 < 10) {
|
1579
1707
|
switch (rem100 % 10) {
|
1580
1708
|
case 1:
|
1581
1709
|
return number + 'st';
|
1710
|
+
|
1582
1711
|
case 2:
|
1583
1712
|
return number + 'nd';
|
1713
|
+
|
1584
1714
|
case 3:
|
1585
1715
|
return number + 'rd';
|
1586
1716
|
}
|
1587
1717
|
}
|
1718
|
+
|
1588
1719
|
return number + 'th';
|
1589
1720
|
};
|
1721
|
+
|
1590
1722
|
var localize = {
|
1591
1723
|
ordinalNumber: ordinalNumber,
|
1592
1724
|
era: buildLocalizeFn({
|
@@ -1622,9 +1754,11 @@ function buildMatchFn(args) {
|
|
1622
1754
|
var width = options.width;
|
1623
1755
|
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
1624
1756
|
var matchResult = string.match(matchPattern);
|
1757
|
+
|
1625
1758
|
if (!matchResult) {
|
1626
1759
|
return null;
|
1627
1760
|
}
|
1761
|
+
|
1628
1762
|
var matchedString = matchResult[0];
|
1629
1763
|
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
1630
1764
|
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
|
@@ -1642,20 +1776,24 @@ function buildMatchFn(args) {
|
|
1642
1776
|
};
|
1643
1777
|
};
|
1644
1778
|
}
|
1779
|
+
|
1645
1780
|
function findKey(object, predicate) {
|
1646
1781
|
for (var key in object) {
|
1647
1782
|
if (object.hasOwnProperty(key) && predicate(object[key])) {
|
1648
1783
|
return key;
|
1649
1784
|
}
|
1650
1785
|
}
|
1786
|
+
|
1651
1787
|
return undefined;
|
1652
1788
|
}
|
1789
|
+
|
1653
1790
|
function findIndex(array, predicate) {
|
1654
1791
|
for (var key = 0; key < array.length; key++) {
|
1655
1792
|
if (predicate(array[key])) {
|
1656
1793
|
return key;
|
1657
1794
|
}
|
1658
1795
|
}
|
1796
|
+
|
1659
1797
|
return undefined;
|
1660
1798
|
}
|
1661
1799
|
|
@@ -1790,7 +1928,9 @@ var locale = {
|
|
1790
1928
|
localize: localize,
|
1791
1929
|
match: match,
|
1792
1930
|
options: {
|
1793
|
-
weekStartsOn: 0
|
1931
|
+
weekStartsOn: 0
|
1932
|
+
/* Sunday */
|
1933
|
+
,
|
1794
1934
|
firstWeekContainsDate: 1
|
1795
1935
|
}
|
1796
1936
|
};
|
@@ -1805,15 +1945,14 @@ var locale = {
|
|
1805
1945
|
// If there is no matching single quote
|
1806
1946
|
// then the sequence will continue until the end of the string.
|
1807
1947
|
// - . matches any single character unmatched by previous parts of the RegExps
|
1808
|
-
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
1809
1948
|
|
1810
|
-
// This RegExp catches symbols escaped by quotes, and also
|
1949
|
+
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
|
1811
1950
|
// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
|
1951
|
+
|
1812
1952
|
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
1813
1953
|
var escapedStringRegExp = /^'([^]*?)'?$/;
|
1814
1954
|
var doubleQuoteRegExp = /''/g;
|
1815
1955
|
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
1816
|
-
|
1817
1956
|
/**
|
1818
1957
|
* @name format
|
1819
1958
|
* @category Common Helpers
|
@@ -2108,36 +2247,40 @@ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
2108
2247
|
|
2109
2248
|
function format(dirtyDate, dirtyFormatStr, options) {
|
2110
2249
|
var _ref, _options$locale, _ref2, _ref3, _ref4, _options$firstWeekCon, _options$locale2, _options$locale2$opti, _defaultOptions$local, _defaultOptions$local2, _ref5, _ref6, _ref7, _options$weekStartsOn, _options$locale3, _options$locale3$opti, _defaultOptions$local3, _defaultOptions$local4;
|
2250
|
+
|
2111
2251
|
requiredArgs(2, arguments);
|
2112
2252
|
var formatStr = String(dirtyFormatStr);
|
2113
2253
|
var defaultOptions = getDefaultOptions();
|
2114
2254
|
var locale$1 = (_ref = (_options$locale = options === null || options === void 0 ? void 0 : options.locale) !== null && _options$locale !== void 0 ? _options$locale : defaultOptions.locale) !== null && _ref !== void 0 ? _ref : locale;
|
2115
|
-
var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1);
|
2255
|
+
var firstWeekContainsDate = toInteger((_ref2 = (_ref3 = (_ref4 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale2 = options.locale) === null || _options$locale2 === void 0 ? void 0 : (_options$locale2$opti = _options$locale2.options) === null || _options$locale2$opti === void 0 ? void 0 : _options$locale2$opti.firstWeekContainsDate) !== null && _ref4 !== void 0 ? _ref4 : defaultOptions.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
2116
2256
|
|
2117
|
-
// Test if weekStartsOn is between 1 and 7 _and_ is not NaN
|
2118
2257
|
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
|
2119
2258
|
throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
|
2120
2259
|
}
|
2121
|
-
var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0);
|
2122
2260
|
|
2123
|
-
// Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
2261
|
+
var weekStartsOn = toInteger((_ref5 = (_ref6 = (_ref7 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale3 = options.locale) === null || _options$locale3 === void 0 ? void 0 : (_options$locale3$opti = _options$locale3.options) === null || _options$locale3$opti === void 0 ? void 0 : _options$locale3$opti.weekStartsOn) !== null && _ref7 !== void 0 ? _ref7 : defaultOptions.weekStartsOn) !== null && _ref6 !== void 0 ? _ref6 : (_defaultOptions$local3 = defaultOptions.locale) === null || _defaultOptions$local3 === void 0 ? void 0 : (_defaultOptions$local4 = _defaultOptions$local3.options) === null || _defaultOptions$local4 === void 0 ? void 0 : _defaultOptions$local4.weekStartsOn) !== null && _ref5 !== void 0 ? _ref5 : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
|
2262
|
+
|
2124
2263
|
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
|
2125
2264
|
throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
|
2126
2265
|
}
|
2266
|
+
|
2127
2267
|
if (!locale$1.localize) {
|
2128
2268
|
throw new RangeError('locale must contain localize property');
|
2129
2269
|
}
|
2270
|
+
|
2130
2271
|
if (!locale$1.formatLong) {
|
2131
2272
|
throw new RangeError('locale must contain formatLong property');
|
2132
2273
|
}
|
2274
|
+
|
2133
2275
|
var originalDate = toDate(dirtyDate);
|
2276
|
+
|
2134
2277
|
if (!isValid(originalDate)) {
|
2135
2278
|
throw new RangeError('Invalid time value');
|
2136
|
-
}
|
2137
|
-
|
2138
|
-
// Convert the date in system timezone to the same date in UTC+00:00 timezone.
|
2279
|
+
} // Convert the date in system timezone to the same date in UTC+00:00 timezone.
|
2139
2280
|
// This ensures that when UTC functions will be implemented, locales will be compatible with them.
|
2140
2281
|
// See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
|
2282
|
+
|
2283
|
+
|
2141
2284
|
var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
|
2142
2285
|
var utcDate = subMilliseconds(originalDate, timezoneOffset);
|
2143
2286
|
var formatterOptions = {
|
@@ -2148,42 +2291,55 @@ function format(dirtyDate, dirtyFormatStr, options) {
|
|
2148
2291
|
};
|
2149
2292
|
var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
|
2150
2293
|
var firstCharacter = substring[0];
|
2294
|
+
|
2151
2295
|
if (firstCharacter === 'p' || firstCharacter === 'P') {
|
2152
2296
|
var longFormatter = longFormatters[firstCharacter];
|
2153
2297
|
return longFormatter(substring, locale$1.formatLong);
|
2154
2298
|
}
|
2299
|
+
|
2155
2300
|
return substring;
|
2156
2301
|
}).join('').match(formattingTokensRegExp).map(function (substring) {
|
2157
2302
|
// Replace two single quote characters with one single quote character
|
2158
2303
|
if (substring === "''") {
|
2159
2304
|
return "'";
|
2160
2305
|
}
|
2306
|
+
|
2161
2307
|
var firstCharacter = substring[0];
|
2308
|
+
|
2162
2309
|
if (firstCharacter === "'") {
|
2163
2310
|
return cleanEscapedString(substring);
|
2164
2311
|
}
|
2312
|
+
|
2165
2313
|
var formatter = formatters[firstCharacter];
|
2314
|
+
|
2166
2315
|
if (formatter) {
|
2167
2316
|
if (!(options !== null && options !== void 0 && options.useAdditionalWeekYearTokens) && isProtectedWeekYearToken(substring)) {
|
2168
2317
|
throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
|
2169
2318
|
}
|
2319
|
+
|
2170
2320
|
if (!(options !== null && options !== void 0 && options.useAdditionalDayOfYearTokens) && isProtectedDayOfYearToken(substring)) {
|
2171
2321
|
throwProtectedError(substring, dirtyFormatStr, String(dirtyDate));
|
2172
2322
|
}
|
2323
|
+
|
2173
2324
|
return formatter(utcDate, substring, locale$1.localize, formatterOptions);
|
2174
2325
|
}
|
2326
|
+
|
2175
2327
|
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
2176
2328
|
throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
|
2177
2329
|
}
|
2330
|
+
|
2178
2331
|
return substring;
|
2179
2332
|
}).join('');
|
2180
2333
|
return result;
|
2181
2334
|
}
|
2335
|
+
|
2182
2336
|
function cleanEscapedString(input) {
|
2183
2337
|
var matched = input.match(escapedStringRegExp);
|
2338
|
+
|
2184
2339
|
if (!matched) {
|
2185
2340
|
return input;
|
2186
2341
|
}
|
2342
|
+
|
2187
2343
|
return matched[1].replace(doubleQuoteRegExp, "'");
|
2188
2344
|
}
|
2189
2345
|
|