esday 0.3.0 → 0.5.0
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/CHANGELOG.md +8 -0
- package/LICENSE +21 -0
- package/README.md +51 -0
- package/chunks/B5f9poqo.js +120 -0
- package/chunks/BDssPbM_.js +106 -0
- package/chunks/BRRrAbUl.js +56 -0
- package/chunks/BXRGSAJG.js +128 -0
- package/chunks/BeVgU2nj.js +188 -0
- package/chunks/BtmEtAW3.js +43 -0
- package/chunks/CQ57zhVp.js +106 -0
- package/chunks/CQJ0-ZuR.js +106 -0
- package/chunks/CWqzr5E5.js +108 -0
- package/chunks/Cb5SvF6r.js +25 -0
- package/chunks/Cg4ZI9v8.js +180 -0
- package/chunks/CoBtJ4c1.js +144 -0
- package/chunks/D009Z-ld.js +109 -0
- package/chunks/DMtTiWuY.js +127 -0
- package/chunks/DXHbH1CI.js +9 -0
- package/chunks/Dixb5KKs.js +116 -0
- package/chunks/DjY7KvwG.js +28 -0
- package/chunks/DqhiVwLi.d.ts +203 -0
- package/chunks/GjKpN6U-.js +135 -0
- package/chunks/MtjcOKi-.d.ts +6 -0
- package/chunks/St35qgL0.d.ts +103 -0
- package/chunks/Y32qdU_5.js +62 -0
- package/chunks/br7kModF.js +110 -0
- package/chunks/l2Rxo2H0.js +106 -0
- package/chunks/tfkJ5D3p.js +115 -0
- package/index.d.ts +3 -6
- package/index.js +552 -326
- package/locales/af.d.ts +8 -0
- package/locales/af.js +106 -0
- package/locales/am.d.ts +8 -0
- package/locales/am.js +106 -0
- package/locales/ar-dz.d.ts +11 -0
- package/locales/ar-dz.js +32 -0
- package/locales/ar-iq.d.ts +11 -0
- package/locales/ar-iq.js +14 -0
- package/locales/ar-kw.d.ts +11 -0
- package/locales/ar-kw.js +28 -0
- package/locales/ar-ly.d.ts +11 -0
- package/locales/ar-ly.js +14 -0
- package/locales/ar-ma.d.ts +11 -0
- package/locales/ar-ma.js +29 -0
- package/locales/ar-sa.d.ts +11 -0
- package/locales/ar-sa.js +29 -0
- package/locales/ar-tn.d.ts +11 -0
- package/locales/ar-tn.js +29 -0
- package/locales/ar.d.ts +8 -0
- package/locales/ar.js +3 -0
- package/locales/az.d.ts +8 -0
- package/locales/az.js +106 -0
- package/locales/be.d.ts +8 -0
- package/locales/be.js +140 -0
- package/locales/bg.d.ts +8 -0
- package/locales/bg.js +125 -0
- package/locales/bi.d.ts +8 -0
- package/locales/bi.js +106 -0
- package/locales/bm.d.ts +8 -0
- package/locales/bm.js +106 -0
- package/locales/bn-bd.d.ts +11 -0
- package/locales/bn-bd.js +24 -0
- package/locales/bn.d.ts +8 -0
- package/locales/bn.js +3 -0
- package/locales/bo.d.ts +8 -0
- package/locales/bo.js +106 -0
- package/locales/br.d.ts +8 -0
- package/locales/br.js +179 -0
- package/locales/bs.d.ts +8 -0
- package/locales/bs.js +128 -0
- package/locales/ca.d.ts +8 -0
- package/locales/ca.js +143 -0
- package/locales/cs.d.ts +8 -0
- package/locales/cs.js +182 -0
- package/locales/cv.d.ts +8 -0
- package/locales/cv.js +106 -0
- package/locales/cy.d.ts +8 -0
- package/locales/cy.js +106 -0
- package/locales/da.d.ts +8 -0
- package/locales/da.js +106 -0
- package/locales/de-at.d.ts +11 -0
- package/locales/de-at.js +44 -0
- package/locales/de-ch.d.ts +11 -0
- package/locales/de-ch.js +14 -0
- package/locales/de.d.ts +8 -0
- package/locales/de.js +3 -0
- package/locales/dv.d.ts +8 -0
- package/locales/dv.js +106 -0
- package/locales/el.d.ts +8 -0
- package/locales/el.js +115 -0
- package/locales/en-au.d.ts +11 -0
- package/locales/en-au.js +27 -0
- package/locales/en-ca.d.ts +11 -0
- package/locales/en-ca.js +27 -0
- package/locales/en-gb.d.ts +13 -0
- package/locales/en-gb.js +28 -0
- package/locales/en-ie.d.ts +11 -0
- package/locales/en-ie.js +26 -0
- package/locales/en-il.d.ts +11 -0
- package/locales/en-il.js +28 -0
- package/locales/en-in.d.ts +11 -0
- package/locales/en-in.js +26 -0
- package/locales/en-nz.d.ts +11 -0
- package/locales/en-nz.js +28 -0
- package/locales/en-sg.d.ts +11 -0
- package/locales/en-sg.js +28 -0
- package/locales/en-tt.d.ts +11 -0
- package/locales/en-tt.js +28 -0
- package/locales/en-us.d.ts +11 -0
- package/locales/en-us.js +13 -0
- package/locales/en.d.ts +8 -0
- package/locales/en.js +3 -0
- package/locales/eo.d.ts +8 -0
- package/locales/eo.js +106 -0
- package/locales/es-do.d.ts +11 -0
- package/locales/es-do.js +27 -0
- package/locales/es-mx.d.ts +11 -0
- package/locales/es-mx.js +15 -0
- package/locales/es-pr.d.ts +11 -0
- package/locales/es-pr.js +18 -0
- package/locales/es-us.d.ts +11 -0
- package/locales/es-us.js +14 -0
- package/locales/es.d.ts +8 -0
- package/locales/es.js +3 -0
- package/locales/et.d.ts +8 -0
- package/locales/et.js +142 -0
- package/locales/eu.d.ts +8 -0
- package/locales/eu.js +106 -0
- package/locales/fa.d.ts +8 -0
- package/locales/fa.js +106 -0
- package/locales/fi.d.ts +8 -0
- package/locales/fi.js +165 -0
- package/locales/fil.d.ts +8 -0
- package/locales/fil.js +106 -0
- package/locales/fo.d.ts +8 -0
- package/locales/fo.js +106 -0
- package/locales/fr-ca.d.ts +11 -0
- package/locales/fr-ca.js +18 -0
- package/locales/fr-ch.d.ts +11 -0
- package/locales/fr-ch.js +18 -0
- package/locales/fr.d.ts +8 -0
- package/locales/fr.js +3 -0
- package/locales/fy.d.ts +8 -0
- package/locales/fy.js +106 -0
- package/locales/ga.d.ts +8 -0
- package/locales/ga.js +106 -0
- package/locales/gd.d.ts +8 -0
- package/locales/gd.js +106 -0
- package/locales/gl.d.ts +8 -0
- package/locales/gl.js +116 -0
- package/locales/gom-deva.d.ts +8 -0
- package/locales/gom-deva.js +146 -0
- package/locales/gom-latn.d.ts +8 -0
- package/locales/gom-latn.js +146 -0
- package/locales/gu.d.ts +8 -0
- package/locales/gu.js +106 -0
- package/locales/he.d.ts +8 -0
- package/locales/he.js +129 -0
- package/locales/hi.d.ts +8 -0
- package/locales/hi.js +125 -0
- package/locales/hr.d.ts +8 -0
- package/locales/hr.js +189 -0
- package/locales/ht.d.ts +8 -0
- package/locales/ht.js +106 -0
- package/locales/hu.d.ts +8 -0
- package/locales/hu.js +140 -0
- package/locales/hy-am.d.ts +8 -0
- package/locales/hy-am.js +127 -0
- package/locales/id.d.ts +8 -0
- package/locales/id.js +106 -0
- package/locales/is.d.ts +8 -0
- package/locales/is.js +155 -0
- package/locales/it-ch.d.ts +11 -0
- package/locales/it-ch.js +32 -0
- package/locales/it.d.ts +8 -0
- package/locales/it.js +3 -0
- package/locales/ja.d.ts +15 -0
- package/locales/ja.js +109 -0
- package/locales/jv.d.ts +8 -0
- package/locales/jv.js +106 -0
- package/locales/ka.d.ts +8 -0
- package/locales/ka.js +126 -0
- package/locales/kk.d.ts +8 -0
- package/locales/kk.js +106 -0
- package/locales/km.d.ts +8 -0
- package/locales/km.js +106 -0
- package/locales/kn.d.ts +8 -0
- package/locales/kn.js +106 -0
- package/locales/ko.d.ts +8 -0
- package/locales/ko.js +105 -0
- package/locales/ku.d.ts +8 -0
- package/locales/ku.js +119 -0
- package/locales/ky.d.ts +8 -0
- package/locales/ky.js +106 -0
- package/locales/lb.d.ts +8 -0
- package/locales/lb.js +166 -0
- package/locales/lo.d.ts +8 -0
- package/locales/lo.js +105 -0
- package/locales/lt.d.ts +8 -0
- package/locales/lt.js +106 -0
- package/locales/lv.d.ts +8 -0
- package/locales/lv.js +106 -0
- package/locales/me.d.ts +8 -0
- package/locales/me.js +129 -0
- package/locales/mi.d.ts +8 -0
- package/locales/mi.js +106 -0
- package/locales/mk.d.ts +8 -0
- package/locales/mk.js +117 -0
- package/locales/ml.d.ts +8 -0
- package/locales/ml.js +109 -0
- package/locales/mn.d.ts +8 -0
- package/locales/mn.js +106 -0
- package/locales/mr.d.ts +8 -0
- package/locales/mr.js +215 -0
- package/locales/ms-my.d.ts +11 -0
- package/locales/ms-my.js +14 -0
- package/locales/ms.d.ts +8 -0
- package/locales/ms.js +3 -0
- package/locales/mt.d.ts +8 -0
- package/locales/mt.js +106 -0
- package/locales/my.d.ts +8 -0
- package/locales/my.js +132 -0
- package/locales/nb.d.ts +8 -0
- package/locales/nb.js +106 -0
- package/locales/ne.d.ts +8 -0
- package/locales/ne.js +106 -0
- package/locales/nl-be.d.ts +11 -0
- package/locales/nl-be.js +18 -0
- package/locales/nl.d.ts +8 -0
- package/locales/nl.js +3 -0
- package/locales/nn.d.ts +8 -0
- package/locales/nn.js +106 -0
- package/locales/oc-lnc.d.ts +8 -0
- package/locales/oc-lnc.js +126 -0
- package/locales/pa-in.d.ts +8 -0
- package/locales/pa-in.js +123 -0
- package/locales/pl.d.ts +8 -0
- package/locales/pl.js +159 -0
- package/locales/pt-br.d.ts +11 -0
- package/locales/pt-br.js +53 -0
- package/locales/pt.d.ts +8 -0
- package/locales/pt.js +3 -0
- package/locales/rn.d.ts +8 -0
- package/locales/rn.js +106 -0
- package/locales/ro.d.ts +8 -0
- package/locales/ro.js +106 -0
- package/locales/ru.d.ts +15 -0
- package/locales/ru.js +236 -0
- package/locales/rw.d.ts +8 -0
- package/locales/rw.js +106 -0
- package/locales/sd.d.ts +8 -0
- package/locales/sd.js +106 -0
- package/locales/se.d.ts +8 -0
- package/locales/se.js +106 -0
- package/locales/si.d.ts +8 -0
- package/locales/si.js +106 -0
- package/locales/sk.d.ts +8 -0
- package/locales/sk.js +162 -0
- package/locales/sl.d.ts +8 -0
- package/locales/sl.js +171 -0
- package/locales/sq.d.ts +8 -0
- package/locales/sq.js +106 -0
- package/locales/sr-cyrl.d.ts +11 -0
- package/locales/sr-cyrl.js +173 -0
- package/locales/sr.d.ts +8 -0
- package/locales/sr.js +3 -0
- package/locales/ss.d.ts +8 -0
- package/locales/ss.js +108 -0
- package/locales/sv-fi.d.ts +11 -0
- package/locales/sv-fi.js +27 -0
- package/locales/sv.d.ts +8 -0
- package/locales/sv.js +3 -0
- package/locales/sw.d.ts +8 -0
- package/locales/sw.js +106 -0
- package/locales/ta.d.ts +8 -0
- package/locales/ta.js +137 -0
- package/locales/te.d.ts +8 -0
- package/locales/te.js +109 -0
- package/locales/tet.d.ts +8 -0
- package/locales/tet.js +110 -0
- package/locales/tg.d.ts +8 -0
- package/locales/tg.js +128 -0
- package/locales/th.d.ts +8 -0
- package/locales/th.js +106 -0
- package/locales/tk.d.ts +8 -0
- package/locales/tk.js +134 -0
- package/locales/tl-ph.d.ts +8 -0
- package/locales/tl-ph.js +106 -0
- package/locales/tlh.d.ts +8 -0
- package/locales/tlh.js +152 -0
- package/locales/tr.d.ts +8 -0
- package/locales/tr.js +134 -0
- package/locales/tzl.d.ts +8 -0
- package/locales/tzl.js +123 -0
- package/locales/tzm-latn.d.ts +11 -0
- package/locales/tzm-latn.js +68 -0
- package/locales/tzm.d.ts +8 -0
- package/locales/tzm.js +3 -0
- package/locales/ug-cn.d.ts +8 -0
- package/locales/ug-cn.js +111 -0
- package/locales/uk.d.ts +8 -0
- package/locales/uk.js +194 -0
- package/locales/ur.d.ts +8 -0
- package/locales/ur.js +108 -0
- package/locales/uz-latn.d.ts +11 -0
- package/locales/uz-latn.js +68 -0
- package/locales/uz.d.ts +8 -0
- package/locales/uz.js +3 -0
- package/locales/vi.d.ts +8 -0
- package/locales/vi.js +106 -0
- package/locales/x-pseudo.d.ts +8 -0
- package/locales/x-pseudo.js +110 -0
- package/locales/yo.d.ts +8 -0
- package/locales/yo.js +106 -0
- package/locales/zh-cn.d.ts +11 -0
- package/locales/zh-cn.js +14 -0
- package/locales/zh-hk.d.ts +11 -0
- package/locales/zh-hk.js +23 -0
- package/locales/zh-mo.d.ts +11 -0
- package/locales/zh-mo.js +23 -0
- package/locales/zh-tw.d.ts +11 -0
- package/locales/zh-tw.js +23 -0
- package/locales/zh.d.ts +15 -0
- package/locales/zh.js +3 -0
- package/package.json +79 -21
- package/plugins/advancedFormat/index.d.ts +8 -0
- package/plugins/advancedFormat/index.js +20 -0
- package/plugins/advancedParse/index.d.ts +8 -0
- package/plugins/advancedParse/index.js +406 -0
- package/plugins/calendar/index.d.ts +14 -0
- package/plugins/calendar/index.js +33 -0
- package/plugins/dayOfYear/index.d.ts +13 -0
- package/plugins/dayOfYear/index.js +12 -0
- package/plugins/isBetween/index.d.ts +23 -0
- package/plugins/isBetween/index.js +16 -0
- package/plugins/isLeapYear/index.d.ts +12 -0
- package/plugins/isLeapYear/index.js +11 -0
- package/plugins/isSameOrAfter/index.d.ts +12 -0
- package/plugins/isSameOrAfter/index.js +10 -0
- package/plugins/isSameOrBefore/index.d.ts +12 -0
- package/plugins/isSameOrBefore/index.js +10 -0
- package/plugins/isToday/index.d.ts +8 -6
- package/plugins/isToday/index.js +10 -6
- package/plugins/isTomorrow/index.d.ts +12 -0
- package/plugins/isTomorrow/index.js +14 -0
- package/plugins/isYesterday/index.d.ts +12 -0
- package/plugins/isYesterday/index.js +14 -0
- package/plugins/isoWeek/index.d.ts +21 -0
- package/plugins/isoWeek/index.js +240 -0
- package/plugins/locale/index.d.ts +4 -0
- package/plugins/locale/index.js +7 -0
- package/plugins/localeData/index.d.ts +8 -0
- package/plugins/localeData/index.js +148 -0
- package/plugins/localizedFormat/index.d.ts +8 -0
- package/plugins/localizedFormat/index.js +88 -0
- package/plugins/localizedParse/index.d.ts +8 -0
- package/plugins/localizedParse/index.js +199 -0
- package/plugins/minMax/index.d.ts +13 -0
- package/plugins/minMax/index.js +22 -0
- package/plugins/objectSupport/index.d.ts +8 -0
- package/plugins/objectSupport/index.js +104 -0
- package/plugins/pluralGetSet/index.d.ts +20 -0
- package/plugins/pluralGetSet/index.js +16 -0
- package/plugins/quarterOfYear/index.d.ts +16 -0
- package/plugins/quarterOfYear/index.js +58 -0
- package/plugins/relativeTime/index.d.ts +59 -0
- package/plugins/relativeTime/index.js +154 -0
- package/plugins/toArray/index.d.ts +12 -0
- package/plugins/toArray/index.js +18 -0
- package/plugins/toObject/index.d.ts +20 -0
- package/plugins/toObject/index.js +18 -0
- package/plugins/utc/index.d.ts +19 -0
- package/plugins/utc/index.js +194 -0
- package/plugins/week/index.d.ts +21 -0
- package/plugins/week/index.js +360 -0
- package/EsDay-CKy0jEj2.d.ts +0 -68
- package/plugins/customParseFormat/index.d.ts +0 -5
- package/plugins/customParseFormat/index.js +0 -159
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
## [0.5.0] (2025-08-09)
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Initial release of the project.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 gmero
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
## esday
|
|
2
|
+
|
|
3
|
+
 [](https://makeapullrequest.com)
|
|
4
|
+
|
|
5
|
+
> 🚧 working in progress
|
|
6
|
+
|
|
7
|
+
> esday is a JavaScript library inspired by [Day.js](https://github.com/iamkun/dayjs), esday has a largely similar API to Day.js (v1.11.13), but it is written in TypeScript and fully supports es modules.
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
import { esday } from 'esday'
|
|
11
|
+
import { isTodayPlugin } from 'esday/plugins/isToday'
|
|
12
|
+
|
|
13
|
+
esday.extend(isTodayPlugin)
|
|
14
|
+
|
|
15
|
+
esday('2024-12-10').set('year', 2025).add(1, 'month').isToday()
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
For detailed information see the [full documentation](https://g-mero.github.io/esday/).
|
|
19
|
+
|
|
20
|
+
## Concepts
|
|
21
|
+
|
|
22
|
+
- **Modern API**: Provides the same API as Day.js, with some features moved to plugins for a simpler core.
|
|
23
|
+
- **Immutable**: esday is immutable, which means that all operations will return a new instance of esday.
|
|
24
|
+
|
|
25
|
+
## Differences to Day.js
|
|
26
|
+
|
|
27
|
+
- **Locale is a Plugin**: no default locale!
|
|
28
|
+
- **default value for 'Start of Week' is 1 (as in ISO 8601)**: 'Start of Week' is 1 ('Monday').
|
|
29
|
+
- **default value for 'Start of Year' is 4 (as in ISO 8601)**: 'Start of Year' is 4.
|
|
30
|
+
- **clamping month on set**: when changing the month and the new month does not have enough days to keep the current day of month, esday behaves like moment.js and clamps to the end of the target month
|
|
31
|
+
- **Invalid Date**: conforms to Moment.js and uses `Invalid date` instead of `Invalid Date`.
|
|
32
|
+
|
|
33
|
+
## Differences to Moment.js
|
|
34
|
+
|
|
35
|
+
Esday uses moment@2.30.1 as api reference.
|
|
36
|
+
|
|
37
|
+
- **toString**: conforms to Day.js and uses Date.toUTCString() (returning the date in RFC 7231 format 'ddd, DD MMM YYYY HH:mm:ss [GMT]') while moment uses the format 'ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'.
|
|
38
|
+
- **toISOString**: conforms to Day.js and returns 'Invalid date' when called on an invalid date. In that case moment returns null (see [moment pr#3710](https://github.com/moment/moment/pull/3710)).
|
|
39
|
+
|
|
40
|
+
## Contribute
|
|
41
|
+
|
|
42
|
+
In the folder `dev` there is a template for creating new plugins and a template for new locale definitions.
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
This project is licensed under the [MIT License](LICENSE).
|
|
47
|
+
|
|
48
|
+
This project also partially contains code derived or copied from the following projects:
|
|
49
|
+
|
|
50
|
+
- [Day.js](https://github.com/iamkun/dayjs)
|
|
51
|
+
- [Moment.js](https://github.com/moment/moment)
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//#region src/locales/it.ts
|
|
2
|
+
const calendar = {
|
|
3
|
+
sameDay() {
|
|
4
|
+
return `[Oggi a${this.hour() > 1 ? "lle " : this.hour() === 0 ? " " : "ll'"}]LT`;
|
|
5
|
+
},
|
|
6
|
+
nextDay() {
|
|
7
|
+
return `[Domani a${this.hour() > 1 ? "lle " : this.hour() === 0 ? " " : "ll'"}]LT`;
|
|
8
|
+
},
|
|
9
|
+
nextWeek() {
|
|
10
|
+
return `dddd [a${this.hour() > 1 ? "lle " : this.hour() === 0 ? " " : "ll'"}]LT`;
|
|
11
|
+
},
|
|
12
|
+
lastDay() {
|
|
13
|
+
return `[Ieri a${this.hour() > 1 ? "lle " : this.hour() === 0 ? " " : "ll'"}]LT`;
|
|
14
|
+
},
|
|
15
|
+
lastWeek() {
|
|
16
|
+
switch (this.day()) {
|
|
17
|
+
case 0: return `[La scorsa] dddd [a${this.hour() > 1 ? "lle " : this.hour() === 0 ? " " : "ll'"}]LT`;
|
|
18
|
+
default: return `[Lo scorso] dddd [a${this.hour() > 1 ? "lle " : this.hour() === 0 ? " " : "ll'"}]LT`;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
sameElse: "L"
|
|
22
|
+
};
|
|
23
|
+
const localeIt = {
|
|
24
|
+
name: "it",
|
|
25
|
+
weekdays: [
|
|
26
|
+
"domenica",
|
|
27
|
+
"lunedì",
|
|
28
|
+
"martedì",
|
|
29
|
+
"mercoledì",
|
|
30
|
+
"giovedì",
|
|
31
|
+
"venerdì",
|
|
32
|
+
"sabato"
|
|
33
|
+
],
|
|
34
|
+
weekdaysShort: [
|
|
35
|
+
"dom",
|
|
36
|
+
"lun",
|
|
37
|
+
"mar",
|
|
38
|
+
"mer",
|
|
39
|
+
"gio",
|
|
40
|
+
"ven",
|
|
41
|
+
"sab"
|
|
42
|
+
],
|
|
43
|
+
weekdaysMin: [
|
|
44
|
+
"do",
|
|
45
|
+
"lu",
|
|
46
|
+
"ma",
|
|
47
|
+
"me",
|
|
48
|
+
"gi",
|
|
49
|
+
"ve",
|
|
50
|
+
"sa"
|
|
51
|
+
],
|
|
52
|
+
months: [
|
|
53
|
+
"gennaio",
|
|
54
|
+
"febbraio",
|
|
55
|
+
"marzo",
|
|
56
|
+
"aprile",
|
|
57
|
+
"maggio",
|
|
58
|
+
"giugno",
|
|
59
|
+
"luglio",
|
|
60
|
+
"agosto",
|
|
61
|
+
"settembre",
|
|
62
|
+
"ottobre",
|
|
63
|
+
"novembre",
|
|
64
|
+
"dicembre"
|
|
65
|
+
],
|
|
66
|
+
monthsShort: [
|
|
67
|
+
"gen",
|
|
68
|
+
"feb",
|
|
69
|
+
"mar",
|
|
70
|
+
"apr",
|
|
71
|
+
"mag",
|
|
72
|
+
"giu",
|
|
73
|
+
"lug",
|
|
74
|
+
"ago",
|
|
75
|
+
"set",
|
|
76
|
+
"ott",
|
|
77
|
+
"nov",
|
|
78
|
+
"dic"
|
|
79
|
+
],
|
|
80
|
+
ordinal: (n) => `${n}º`,
|
|
81
|
+
weekStart: 1,
|
|
82
|
+
yearStart: 4,
|
|
83
|
+
formats: {
|
|
84
|
+
LT: "HH:mm",
|
|
85
|
+
LTS: "HH:mm:ss",
|
|
86
|
+
L: "DD/MM/YYYY",
|
|
87
|
+
LL: "D MMMM YYYY",
|
|
88
|
+
LLL: "D MMMM YYYY HH:mm",
|
|
89
|
+
LLLL: "dddd D MMMM YYYY HH:mm",
|
|
90
|
+
l: "DD/MM/YYYY",
|
|
91
|
+
ll: "D MMMM YYYY",
|
|
92
|
+
lll: "D MMMM YYYY HH:mm",
|
|
93
|
+
llll: "dddd D MMMM YYYY HH:mm"
|
|
94
|
+
},
|
|
95
|
+
calendar,
|
|
96
|
+
relativeTime: {
|
|
97
|
+
future: "tra %s",
|
|
98
|
+
past: "%s fa",
|
|
99
|
+
s: "qualche secondo",
|
|
100
|
+
ss: "%d secondi",
|
|
101
|
+
m: "un minuto",
|
|
102
|
+
mm: "%d minuti",
|
|
103
|
+
h: "un' ora",
|
|
104
|
+
hh: "%d ore",
|
|
105
|
+
d: "un giorno",
|
|
106
|
+
dd: "%d giorni",
|
|
107
|
+
M: "un mese",
|
|
108
|
+
MM: "%d mesi",
|
|
109
|
+
y: "un anno",
|
|
110
|
+
yy: "%d anni"
|
|
111
|
+
},
|
|
112
|
+
meridiem: (hour, _minute, isLowercase) => {
|
|
113
|
+
const m = hour < 12 ? "AM" : "PM";
|
|
114
|
+
return isLowercase ? m.toLowerCase() : m;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
var it_default = localeIt;
|
|
118
|
+
|
|
119
|
+
//#endregion
|
|
120
|
+
export { it_default };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region src/locales/nl.ts
|
|
2
|
+
const localeNl = {
|
|
3
|
+
name: "nl",
|
|
4
|
+
weekdays: [
|
|
5
|
+
"zondag",
|
|
6
|
+
"maandag",
|
|
7
|
+
"dinsdag",
|
|
8
|
+
"woensdag",
|
|
9
|
+
"donderdag",
|
|
10
|
+
"vrijdag",
|
|
11
|
+
"zaterdag"
|
|
12
|
+
],
|
|
13
|
+
weekdaysShort: [
|
|
14
|
+
"zo.",
|
|
15
|
+
"ma.",
|
|
16
|
+
"di.",
|
|
17
|
+
"wo.",
|
|
18
|
+
"do.",
|
|
19
|
+
"vr.",
|
|
20
|
+
"za."
|
|
21
|
+
],
|
|
22
|
+
weekdaysMin: [
|
|
23
|
+
"zo",
|
|
24
|
+
"ma",
|
|
25
|
+
"di",
|
|
26
|
+
"wo",
|
|
27
|
+
"do",
|
|
28
|
+
"vr",
|
|
29
|
+
"za"
|
|
30
|
+
],
|
|
31
|
+
months: [
|
|
32
|
+
"januari",
|
|
33
|
+
"februari",
|
|
34
|
+
"maart",
|
|
35
|
+
"april",
|
|
36
|
+
"mei",
|
|
37
|
+
"juni",
|
|
38
|
+
"juli",
|
|
39
|
+
"augustus",
|
|
40
|
+
"september",
|
|
41
|
+
"oktober",
|
|
42
|
+
"november",
|
|
43
|
+
"december"
|
|
44
|
+
],
|
|
45
|
+
monthsShort: [
|
|
46
|
+
"jan",
|
|
47
|
+
"feb",
|
|
48
|
+
"mrt",
|
|
49
|
+
"apr",
|
|
50
|
+
"mei",
|
|
51
|
+
"jun",
|
|
52
|
+
"jul",
|
|
53
|
+
"aug",
|
|
54
|
+
"sep",
|
|
55
|
+
"okt",
|
|
56
|
+
"nov",
|
|
57
|
+
"dec"
|
|
58
|
+
],
|
|
59
|
+
ordinal: (n) => `[${n}${n === 1 || n === 8 || n >= 20 ? "ste" : "de"}]`,
|
|
60
|
+
weekStart: 1,
|
|
61
|
+
yearStart: 4,
|
|
62
|
+
formats: {
|
|
63
|
+
LT: "HH:mm",
|
|
64
|
+
LTS: "HH:mm:ss",
|
|
65
|
+
L: "DD-MM-YYYY",
|
|
66
|
+
LL: "D MMMM YYYY",
|
|
67
|
+
LLL: "D MMMM YYYY HH:mm",
|
|
68
|
+
LLLL: "dddd D MMMM YYYY HH:mm",
|
|
69
|
+
l: "DD-MM-YYYY",
|
|
70
|
+
ll: "D MMMM YYYY",
|
|
71
|
+
lll: "D MMMM YYYY HH:mm",
|
|
72
|
+
llll: "dddd D MMMM YYYY HH:mm"
|
|
73
|
+
},
|
|
74
|
+
calendar: {
|
|
75
|
+
sameDay: "[vandaag om] LT",
|
|
76
|
+
nextDay: "[morgen om] LT",
|
|
77
|
+
nextWeek: "dddd [om] LT",
|
|
78
|
+
lastDay: "[gisteren om] LT",
|
|
79
|
+
lastWeek: "[afgelopen] dddd [om] LT",
|
|
80
|
+
sameElse: "L"
|
|
81
|
+
},
|
|
82
|
+
relativeTime: {
|
|
83
|
+
future: "over %s",
|
|
84
|
+
past: "%s geleden",
|
|
85
|
+
s: "een paar seconden",
|
|
86
|
+
ss: "%d seconden",
|
|
87
|
+
m: "een minuut",
|
|
88
|
+
mm: "%d minuten",
|
|
89
|
+
h: "een uur",
|
|
90
|
+
hh: "%d uur",
|
|
91
|
+
d: "een dag",
|
|
92
|
+
dd: "%d dagen",
|
|
93
|
+
M: "een maand",
|
|
94
|
+
MM: "%d maanden",
|
|
95
|
+
y: "een jaar",
|
|
96
|
+
yy: "%d jaar"
|
|
97
|
+
},
|
|
98
|
+
meridiem: (hour, _minute, isLowercase) => {
|
|
99
|
+
const m = hour < 12 ? "AM" : "PM";
|
|
100
|
+
return isLowercase ? m.toLowerCase() : m;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
var nl_default = localeNl;
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
export { nl_default };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//#region src/common/str-utils.ts
|
|
2
|
+
/**
|
|
3
|
+
* Pad the start of a string with a specified character
|
|
4
|
+
* @param origin the string or number to pad
|
|
5
|
+
* @param length the length of the final string
|
|
6
|
+
* @param pad the character to pad with
|
|
7
|
+
* @returns the padded string
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
*
|
|
11
|
+
* padStart('hello', 10, 'a') // 'aaaaahello'
|
|
12
|
+
*/
|
|
13
|
+
function padStart(origin, length, pad) {
|
|
14
|
+
const originStr = String(origin);
|
|
15
|
+
if (!originStr || originStr.length >= length) return originStr;
|
|
16
|
+
return `${Array.from({ length: length + 1 - originStr.length }).join(pad)}${originStr}`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Add leading zeros to a number to get the defined length: if
|
|
20
|
+
* the number is negative, the dash is appended after padding, the
|
|
21
|
+
* resulting string has 'length+1' characters
|
|
22
|
+
* @param origin the number to pad
|
|
23
|
+
* @param length the length of the final string (without dash)
|
|
24
|
+
* @returns the padded string
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
*
|
|
28
|
+
* padStart(1, 4) // '0001'
|
|
29
|
+
*/
|
|
30
|
+
function padNumberWithLeadingZeros(origin, length) {
|
|
31
|
+
const isNegative = origin < 0;
|
|
32
|
+
let result = String(origin);
|
|
33
|
+
let dash = "";
|
|
34
|
+
if (isNegative) {
|
|
35
|
+
result = result.slice(1);
|
|
36
|
+
dash = "-";
|
|
37
|
+
}
|
|
38
|
+
return `${dash}${result.padStart(length, "0")}`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Format utcOffset as a string with format 'hh:mm':
|
|
42
|
+
* hh: hours of the utcOffset
|
|
43
|
+
* mm: minutes of the utcOffset
|
|
44
|
+
* @param utcOffset - utcOffset to convert to a string
|
|
45
|
+
* @returns utcOffset formatted as a string
|
|
46
|
+
*/
|
|
47
|
+
function padZoneStr(utcOffset) {
|
|
48
|
+
const negMinutes = -utcOffset;
|
|
49
|
+
const minutes = Math.abs(negMinutes);
|
|
50
|
+
const hourOffset = Math.floor(minutes / 60);
|
|
51
|
+
const minuteOffset = minutes % 60;
|
|
52
|
+
return `${negMinutes <= 0 ? "+" : "-"}${padStart(hourOffset, 2, "0")}:${padStart(minuteOffset, 2, "0")}`;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { padNumberWithLeadingZeros, padStart, padZoneStr };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
//#region src/locales/zh.ts
|
|
2
|
+
const localeZh = {
|
|
3
|
+
name: "zh",
|
|
4
|
+
weekdays: [
|
|
5
|
+
"星期日",
|
|
6
|
+
"星期一",
|
|
7
|
+
"星期二",
|
|
8
|
+
"星期三",
|
|
9
|
+
"星期四",
|
|
10
|
+
"星期五",
|
|
11
|
+
"星期六"
|
|
12
|
+
],
|
|
13
|
+
weekdaysShort: [
|
|
14
|
+
"周日",
|
|
15
|
+
"周一",
|
|
16
|
+
"周二",
|
|
17
|
+
"周三",
|
|
18
|
+
"周四",
|
|
19
|
+
"周五",
|
|
20
|
+
"周六"
|
|
21
|
+
],
|
|
22
|
+
weekdaysMin: [
|
|
23
|
+
"日",
|
|
24
|
+
"一",
|
|
25
|
+
"二",
|
|
26
|
+
"三",
|
|
27
|
+
"四",
|
|
28
|
+
"五",
|
|
29
|
+
"六"
|
|
30
|
+
],
|
|
31
|
+
months: [
|
|
32
|
+
"一月",
|
|
33
|
+
"二月",
|
|
34
|
+
"三月",
|
|
35
|
+
"四月",
|
|
36
|
+
"五月",
|
|
37
|
+
"六月",
|
|
38
|
+
"七月",
|
|
39
|
+
"八月",
|
|
40
|
+
"九月",
|
|
41
|
+
"十月",
|
|
42
|
+
"十一月",
|
|
43
|
+
"十二月"
|
|
44
|
+
],
|
|
45
|
+
monthsShort: [
|
|
46
|
+
"1月",
|
|
47
|
+
"2月",
|
|
48
|
+
"3月",
|
|
49
|
+
"4月",
|
|
50
|
+
"5月",
|
|
51
|
+
"6月",
|
|
52
|
+
"7月",
|
|
53
|
+
"8月",
|
|
54
|
+
"9月",
|
|
55
|
+
"10月",
|
|
56
|
+
"11月",
|
|
57
|
+
"12月"
|
|
58
|
+
],
|
|
59
|
+
ordinal: (number, period) => {
|
|
60
|
+
const p = period ?? "";
|
|
61
|
+
switch (p) {
|
|
62
|
+
case "d":
|
|
63
|
+
case "D":
|
|
64
|
+
case "DDD": return `${number}日`;
|
|
65
|
+
case "M": return `${number}月`;
|
|
66
|
+
case "w":
|
|
67
|
+
case "W": return `${number}周`;
|
|
68
|
+
default: return number.toString();
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
weekStart: 1,
|
|
72
|
+
yearStart: 4,
|
|
73
|
+
formats: {
|
|
74
|
+
LT: "HH:mm",
|
|
75
|
+
LTS: "HH:mm:ss",
|
|
76
|
+
L: "YYYY/MM/DD",
|
|
77
|
+
LL: "YYYY年M月D日",
|
|
78
|
+
LLL: "YYYY年M月D日Ah点mm分",
|
|
79
|
+
LLLL: "YYYY年M月D日ddddAh点mm分",
|
|
80
|
+
l: "YYYY/M/D",
|
|
81
|
+
ll: "YYYY年M月D日",
|
|
82
|
+
lll: "YYYY年M月D日 HH:mm",
|
|
83
|
+
llll: "YYYY年M月D日dddd HH:mm"
|
|
84
|
+
},
|
|
85
|
+
calendar: {
|
|
86
|
+
sameDay: "[今天]LT",
|
|
87
|
+
nextDay: "[明天]LT",
|
|
88
|
+
nextWeek(refDate) {
|
|
89
|
+
if (refDate?.week?.() !== this.week?.()) return "[下]dddLT";
|
|
90
|
+
return "[本]dddLT";
|
|
91
|
+
},
|
|
92
|
+
lastDay: "[昨天]LT",
|
|
93
|
+
lastWeek(refDate) {
|
|
94
|
+
if (this.week?.() !== refDate?.week?.()) return "[上]dddLT";
|
|
95
|
+
return "[本]dddLT";
|
|
96
|
+
},
|
|
97
|
+
sameElse: "L"
|
|
98
|
+
},
|
|
99
|
+
relativeTime: {
|
|
100
|
+
future: "%s后",
|
|
101
|
+
past: "%s前",
|
|
102
|
+
s: "几秒",
|
|
103
|
+
ss: "%d 秒",
|
|
104
|
+
m: "1 分钟",
|
|
105
|
+
mm: "%d 分钟",
|
|
106
|
+
h: "1 小时",
|
|
107
|
+
hh: "%d 小时",
|
|
108
|
+
d: "1 天",
|
|
109
|
+
dd: "%d 天",
|
|
110
|
+
M: "1 个月",
|
|
111
|
+
MM: "%d 个月",
|
|
112
|
+
y: "1 年",
|
|
113
|
+
yy: "%d 年"
|
|
114
|
+
},
|
|
115
|
+
meridiem: (hour, minute) => {
|
|
116
|
+
const hm = hour * 100 + minute;
|
|
117
|
+
if (hm < 600) return "凌晨";
|
|
118
|
+
if (hm < 900) return "早上";
|
|
119
|
+
if (hm < 1100) return "上午";
|
|
120
|
+
if (hm < 1300) return "中午";
|
|
121
|
+
if (hm < 1800) return "下午";
|
|
122
|
+
return "晚上";
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
var zh_default = localeZh;
|
|
126
|
+
|
|
127
|
+
//#endregion
|
|
128
|
+
export { zh_default };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
//#region src/locales/ar.ts
|
|
2
|
+
const arabicToEnglishNumbersMap = {
|
|
3
|
+
"١": "1",
|
|
4
|
+
"٢": "2",
|
|
5
|
+
"٣": "3",
|
|
6
|
+
"٤": "4",
|
|
7
|
+
"٥": "5",
|
|
8
|
+
"٦": "6",
|
|
9
|
+
"٧": "7",
|
|
10
|
+
"٨": "8",
|
|
11
|
+
"٩": "9",
|
|
12
|
+
"٠": "0"
|
|
13
|
+
};
|
|
14
|
+
const englishToArabicNumbersMap = {
|
|
15
|
+
1: "١",
|
|
16
|
+
2: "٢",
|
|
17
|
+
3: "٣",
|
|
18
|
+
4: "٤",
|
|
19
|
+
5: "٥",
|
|
20
|
+
6: "٦",
|
|
21
|
+
7: "٧",
|
|
22
|
+
8: "٨",
|
|
23
|
+
9: "٩",
|
|
24
|
+
0: "٠"
|
|
25
|
+
};
|
|
26
|
+
const pluralForm = (value) => value === 0 ? 0 : value === 1 ? 1 : value === 2 ? 2 : value % 100 >= 3 && value % 100 <= 10 ? 3 : value % 100 >= 11 ? 4 : 5;
|
|
27
|
+
const plurals = {
|
|
28
|
+
s: [
|
|
29
|
+
"أقل من ثانية",
|
|
30
|
+
"ثانية واحدة",
|
|
31
|
+
["ثانيتان", "ثانيتين"],
|
|
32
|
+
"%d ثوان",
|
|
33
|
+
"%d ثانية",
|
|
34
|
+
"%d ثانية"
|
|
35
|
+
],
|
|
36
|
+
m: [
|
|
37
|
+
"أقل من دقيقة",
|
|
38
|
+
"دقيقة واحدة",
|
|
39
|
+
["دقيقتان", "دقيقتين"],
|
|
40
|
+
"%d دقائق",
|
|
41
|
+
"%d دقيقة",
|
|
42
|
+
"%d دقيقة"
|
|
43
|
+
],
|
|
44
|
+
h: [
|
|
45
|
+
"أقل من ساعة",
|
|
46
|
+
"ساعة واحدة",
|
|
47
|
+
["ساعتان", "ساعتين"],
|
|
48
|
+
"%d ساعات",
|
|
49
|
+
"%d ساعة",
|
|
50
|
+
"%d ساعة"
|
|
51
|
+
],
|
|
52
|
+
d: [
|
|
53
|
+
"أقل من يوم",
|
|
54
|
+
"يوم واحد",
|
|
55
|
+
["يومان", "يومين"],
|
|
56
|
+
"%d أيام",
|
|
57
|
+
"%d يومًا",
|
|
58
|
+
"%d يوم"
|
|
59
|
+
],
|
|
60
|
+
M: [
|
|
61
|
+
"أقل من شهر",
|
|
62
|
+
"شهر واحد",
|
|
63
|
+
["شهران", "شهرين"],
|
|
64
|
+
"%d أشهر",
|
|
65
|
+
"%d شهرا",
|
|
66
|
+
"%d شهر"
|
|
67
|
+
],
|
|
68
|
+
y: [
|
|
69
|
+
"أقل من عام",
|
|
70
|
+
"عام واحد",
|
|
71
|
+
["عامان", "عامين"],
|
|
72
|
+
"%d أعوام",
|
|
73
|
+
"%d عامًا",
|
|
74
|
+
"%d عام"
|
|
75
|
+
]
|
|
76
|
+
};
|
|
77
|
+
const pluralize = (unit) => (timeValue, withoutSuffix, _token, _isFuture) => {
|
|
78
|
+
const timeValueAsNumber = Number(timeValue);
|
|
79
|
+
const pluralFormToUse = pluralForm(timeValueAsNumber);
|
|
80
|
+
let plural = plurals[unit][pluralForm(timeValueAsNumber)];
|
|
81
|
+
if (pluralFormToUse === 2) plural = plural[withoutSuffix ? 0 : 1];
|
|
82
|
+
else plural = plural;
|
|
83
|
+
return plural.replace(/%d/i, `${timeValue}`);
|
|
84
|
+
};
|
|
85
|
+
const locale = {
|
|
86
|
+
name: "ar",
|
|
87
|
+
weekdays: [
|
|
88
|
+
"الأحد",
|
|
89
|
+
"الإثنين",
|
|
90
|
+
"الثلاثاء",
|
|
91
|
+
"الأربعاء",
|
|
92
|
+
"الخميس",
|
|
93
|
+
"الجمعة",
|
|
94
|
+
"السبت"
|
|
95
|
+
],
|
|
96
|
+
weekdaysShort: [
|
|
97
|
+
"أحد",
|
|
98
|
+
"إثنين",
|
|
99
|
+
"ثلاثاء",
|
|
100
|
+
"أربعاء",
|
|
101
|
+
"خميس",
|
|
102
|
+
"جمعة",
|
|
103
|
+
"سبت"
|
|
104
|
+
],
|
|
105
|
+
weekdaysMin: [
|
|
106
|
+
"ح",
|
|
107
|
+
"ن",
|
|
108
|
+
"ث",
|
|
109
|
+
"ر",
|
|
110
|
+
"خ",
|
|
111
|
+
"ج",
|
|
112
|
+
"س"
|
|
113
|
+
],
|
|
114
|
+
months: [
|
|
115
|
+
"يناير",
|
|
116
|
+
"فبراير",
|
|
117
|
+
"مارس",
|
|
118
|
+
"أبريل",
|
|
119
|
+
"مايو",
|
|
120
|
+
"يونيو",
|
|
121
|
+
"يوليو",
|
|
122
|
+
"أغسطس",
|
|
123
|
+
"سبتمبر",
|
|
124
|
+
"أكتوبر",
|
|
125
|
+
"نوفمبر",
|
|
126
|
+
"ديسمبر"
|
|
127
|
+
],
|
|
128
|
+
monthsShort: [
|
|
129
|
+
"يناير",
|
|
130
|
+
"فبراير",
|
|
131
|
+
"مارس",
|
|
132
|
+
"أبريل",
|
|
133
|
+
"مايو",
|
|
134
|
+
"يونيو",
|
|
135
|
+
"يوليو",
|
|
136
|
+
"أغسطس",
|
|
137
|
+
"سبتمبر",
|
|
138
|
+
"أكتوبر",
|
|
139
|
+
"نوفمبر",
|
|
140
|
+
"ديسمبر"
|
|
141
|
+
],
|
|
142
|
+
ordinal: (n) => `${n}`,
|
|
143
|
+
weekStart: 6,
|
|
144
|
+
yearStart: 1,
|
|
145
|
+
formats: {
|
|
146
|
+
LT: "HH:mm",
|
|
147
|
+
LTS: "HH:mm:ss",
|
|
148
|
+
L: "D/M/YYYY",
|
|
149
|
+
LL: "D MMMM YYYY",
|
|
150
|
+
LLL: "D MMMM YYYY HH:mm",
|
|
151
|
+
LLLL: "dddd D MMMM YYYY HH:mm",
|
|
152
|
+
l: "D/M/YYYY",
|
|
153
|
+
ll: "D MMMM YYYY",
|
|
154
|
+
lll: "D MMMM YYYY HH:mm",
|
|
155
|
+
llll: "dddd D MMMM YYYY HH:mm"
|
|
156
|
+
},
|
|
157
|
+
calendar: {
|
|
158
|
+
sameDay: "[اليوم عند الساعة] LT",
|
|
159
|
+
nextDay: "[غدًا عند الساعة] LT",
|
|
160
|
+
nextWeek: "dddd [عند الساعة] LT",
|
|
161
|
+
lastDay: "[أمس عند الساعة] LT",
|
|
162
|
+
lastWeek: "dddd [عند الساعة] LT",
|
|
163
|
+
sameElse: "L"
|
|
164
|
+
},
|
|
165
|
+
relativeTime: {
|
|
166
|
+
future: "بعد %s",
|
|
167
|
+
past: "منذ %s",
|
|
168
|
+
s: pluralize("s"),
|
|
169
|
+
ss: pluralize("s"),
|
|
170
|
+
m: pluralize("m"),
|
|
171
|
+
mm: pluralize("m"),
|
|
172
|
+
h: pluralize("h"),
|
|
173
|
+
hh: pluralize("h"),
|
|
174
|
+
d: pluralize("d"),
|
|
175
|
+
dd: pluralize("d"),
|
|
176
|
+
M: pluralize("M"),
|
|
177
|
+
MM: pluralize("M"),
|
|
178
|
+
y: pluralize("y"),
|
|
179
|
+
yy: pluralize("y")
|
|
180
|
+
},
|
|
181
|
+
meridiem: (hour, _minute, _isLowercase) => hour > 12 ? "م" : "ص",
|
|
182
|
+
preParse: (dateString) => dateString.replace(/[١٢٣٤٥٦٧٨٩٠]/g, (match) => arabicToEnglishNumbersMap[match]).replace(/،/g, ","),
|
|
183
|
+
postFormat: (formattedDate) => formattedDate.replace(/\d/g, (match) => englishToArabicNumbersMap[Number(match)]).replace(/,/g, "،")
|
|
184
|
+
};
|
|
185
|
+
var ar_default = locale;
|
|
186
|
+
|
|
187
|
+
//#endregion
|
|
188
|
+
export { ar_default };
|