Skip to content

Commit 1ae3dd8

Browse files
authored
Update to 2024b. (#45)
* Updated to 2023d. Fixed testing to account for updated date formats. * Updated to 2024a. * Updated to 2024b. * Updated to 2024b, part 2.
1 parent 84b3c6b commit 1ae3dd8

File tree

10 files changed

+3809
-9170
lines changed

10 files changed

+3809
-9170
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -279,18 +279,18 @@ For example:
279279

280280
## Moment.js-style localized formats
281281

282-
| | Token | Output |
283-
| -------|------:|------- |
284-
| Month name, day of month, day of week, year, time | LLLL | Thursday, September 4, 1986 8:30 PM |
285-
| | llll | Thu, Sep 4, 1986 8:30 PM |
286-
| Month name, day of month, year, time | LLL | September 4, 1986 8:30 PM |
287-
| | lll | Sep 4, 1986 8:30 PM |
288-
| Month name, day of month, year | LL | September 4, 1986 |
289-
| | ll | Sep 4, 1986 |
290-
| Month numeral, day of month, year | L | 09/04/1986 |
291-
| | l | 9/4/1986 |
292-
| Time with seconds | LTS | 8:30:25 PM |
293-
| Time | LT | 8:30 PM |
282+
| | Token | Output |
283+
| -------|------:|-----------------------------------------|
284+
| Month name, day of month, day of week, year, time | LLLL | Thursday, September 4, 1986 at 8:30 PM |
285+
| | llll | Thu, Sep 4, 1986 8:30 PM |
286+
| Month name, day of month, year, time | LLL | September 4, 1986 8:30 PM |
287+
| | lll | Sep 4, 1986 8:30 PM |
288+
| Month name, day of month, year | LL | September 4, 1986 |
289+
| | ll | Sep 4, 1986 |
290+
| Month numeral, day of month, year | L | 09/04/1986 |
291+
| | l | 9/4/1986 |
292+
| Time with seconds | LTS | 8:30:25 PM |
293+
| Time | LT | 8:30 PM |
294294

295295
## @tubular/time `Intl.DateTimeFormat` shorthand string formats
296296

package-lock.json

Lines changed: 3081 additions & 8442 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tubular/time",
3-
"version": "3.8.15",
3+
"version": "3.9.2",
44
"description": "Date/time, IANA timezones, leap seconds, TAI/UTC conversions, calendar with settable Julian/Gregorian switchover",
55
"main": "dist/cjs/index.js",
66
"module": "dist/fesm2015/index.js",
@@ -46,15 +46,15 @@
4646
"author": "Kerry Shetline <kerry@shetline.com>",
4747
"license": "MIT",
4848
"dependencies": {
49-
"@tubular/math": "^3.2.0",
50-
"@tubular/util": "^4.13.1"
49+
"@tubular/math": "^3.3.1",
50+
"@tubular/util": "^4.16.1"
5151
},
5252
"optionalDependencies": {
53-
"by-request": "^1.3.3",
53+
"by-request": "^1.3.4",
5454
"json-z": "^3.3.2"
5555
},
5656
"devDependencies": {
57-
"@babel/core": "^7.17.10",
57+
"@babel/core": "^7.23.6",
5858
"@babel/preset-env": "^7.17.10",
5959
"@babel/register": "^7.17.7",
6060
"@rollup/plugin-typescript": "^8.3.2",
@@ -72,7 +72,7 @@
7272
"eslint-plugin-import": "^2.26.0",
7373
"eslint-plugin-node": "^11.1.0",
7474
"eslint-plugin-promise": "^6.0.0",
75-
"mocha": "^9.2.2",
75+
"mocha": "^10.2.0",
7676
"nyc": "^15.1.0",
7777
"rimraf": "^3.0.2",
7878
"rollup": "^2.71.1",

src/format-parse.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('FormatParse', () => {
2929
expect(new DateTime('20212-06-04').format('Y-MM-DD')).to.equal('+20212-06-04');
3030
expect(new DateTime('1986-09-04T20:30:03').format('yyyy-MMM-DD, hh:mm A')).to.equal('1986-Sep-04, 08:30 PM');
3131
expect(new DateTime('1986-09-04T20:30:03').format('LTS')).to.equal('8:30:03 PM');
32-
expect(new DateTime('1986-09-04T20:30:03').format('LLLL')).to.equal('Thursday, September 4, 1986, 8:30 PM');
32+
expect(new DateTime('1986-09-04T20:30:03').format('LLLL')).to.equal('Thursday, September 4, 1986 at 8:30 PM');
3333
expect(new DateTime('1986-09-04T20:30:03').format('ILS')).to.equal('September 4, 1986 at 8:30 PM');
3434
expect(new DateTime('1986-09-04T20:30:03 America/New_York').format('IxL')).to.equal('8:30:03 PM EDT');
3535
expect(new DateTime('1986-09-04T20:30:03Z').format('IxL')).to.equal('8:30:03 PM UTC');
@@ -45,8 +45,8 @@ describe('FormatParse', () => {
4545
expect(new DateTime('1986-09-04').toLocale(['qq', 'fr']).format('IS')).to.equal('04/09/1986');
4646
expect(new DateTime('1986-09-04').format('D\u200F/M\u200F/YYYY h:mm A', 'ar')).to.equal('٤\u200F/٩\u200F/١٩٨٦ ١٢:٠٠ ص');
4747
expect(new DateTime('1986-09-04').format('D/M/YY h:mm A', 'bn')).to.equal('৪/৯/৮৬ ১২:০০ AM');
48-
expect(new DateTime('1986-09-04').format('ISS', 'bn')).to.equal('৪/৯/৮৬ ১২:০০ AM');
49-
expect(new DateTime('1986-09-04').format('ISS{numberingSystem:latn}', 'bn')).to.equal('4/9/86 12:00 AM');
48+
expect(new DateTime('1986-09-04').format('ISS', 'bn')).to.equal('৪/৯/৮৬, ১২:০০ AM');
49+
expect(new DateTime('1986-09-04').format('ISS{numberingSystem:latn}', 'bn')).to.equal('4/9/86, 12:00 AM');
5050
expect(new DateTime('1986-09-04').format('DD-MM-YY နံနက် H:mm', 'my')).to.equal('၀၄-၀၉-၈၆ နံနက် ၀:၀၀');
5151
});
5252

src/format-parse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,9 +942,9 @@ function generatePredefinedFormats(locale: ILocale, timezone: string): void {
942942
});
943943
}
944944
else {
945-
locale.dateTimeFormats.LLLL = 'dddd, MMMM D, YYYY h:mm A'; // Thursday, September 4, 1986 8:30 PM
945+
locale.dateTimeFormats.LLLL = 'dddd, MMMM D, YYYY at h:mm A'; // Thursday, September 4, 1986 8:30 PM
946946
locale.dateTimeFormats.llll = 'ddd, MMM D, YYYY h:mm A'; // Thu, Sep 4, 1986 8:30 PM
947-
locale.dateTimeFormats.LLL = 'MMMM D, YYYY h:mm A'; // September 4, 1986 8:30 PM
947+
locale.dateTimeFormats.LLL = 'MMMM D, YYYY at h:mm A'; // September 4, 1986 8:30 PM
948948
locale.dateTimeFormats.lll = 'MMM D, YYYY h:mm A'; // Sep 4, 1986 8:30 PM
949949
locale.dateTimeFormats.LTS = 'h:mm:ss A'; // 8:30:25 PM
950950
locale.dateTimeFormats.LT = 'h:mm A'; // 8:30 PM

src/index.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ describe('Zone updates', () => {
7171
expect(ttime('May 8, 1945 UTC', 'MMM D, Y z').epochMillis).to.equal(Date.parse('May 8, 1945 00:00+00:00'));
7272
expect(ttime('8/5/1945', 'IS', 'es').format('IM')).to.match(/^8 may\.? 1945$/);
7373
expect(ttime('8/5/45', 'IS', 'es').format('IM')).to.match(/^8 may\.? 2045$/);
74-
expect(ttime('2/5/1955 03:12 am', 'ISS').format('LLLL')).to.equal('Saturday, February 5, 1955, 3:12 AM');
74+
expect(ttime('2/5/1955 03:12 am', 'ISS').format('LLLL')).to.equal('Saturday, February 5, 1955 at 3:12 AM');
7575
expect(ttime('2/5/1955 03:12 am', 'ISS').format('llll')).to.equal('Sat, Feb 5, 1955, 3:12 AM');
76-
expect(ttime('2/5/1955 03:12 am', 'ISS').format('LLL')).to.equal('February 5, 1955, 3:12 AM');
76+
expect(ttime('2/5/1955 03:12 am', 'ISS').format('LLL')).to.equal('February 5, 1955 at 3:12 AM');
7777
expect(ttime([1955, 2, 5, 3, 12]).format('lll')).to.equal('Feb 5, 1955, 3:12 AM');
7878
expect(ttime('2/5/1955 03:12 am', 'ISS').format('LL')).to.equal('February 5, 1955');
7979
expect(ttime('2/5/1955 03:12 am', 'ISS').format('ll')).to.equal('Feb 5, 1955');
@@ -110,9 +110,9 @@ describe('Zone updates', () => {
110110
});
111111

112112
it('should be able to create DateTimeFormat instances without dateStyle/timeStyle exceptions', () => {
113-
expect(() => newDateTimeFormat('fr', { timeStyle: 'short', hour: '2-digit' })).to.not.throw();
113+
expect(() => newDateTimeFormat('fr', { timeStyle: 'short', hour: '2-digit' } as any)).to.not.throw();
114114

115-
const options = newDateTimeFormat('en-US', { dateStyle: 'short', era: 'short' }).resolvedOptions();
115+
const options = newDateTimeFormat('en-US', { dateStyle: 'short', era: 'short' } as any).resolvedOptions();
116116

117117
expect(options.era).to.equal('short');
118118
expect((options as any).dateStyle).to.be.undefined;

0 commit comments

Comments
 (0)