Skip to content

Commit fe2566d

Browse files
Merge branch 'alpha' of github.com:TanStack/time into alpha
2 parents 757a936 + 450aae7 commit fe2566d

5 files changed

Lines changed: 733 additions & 735 deletions

File tree

docs/reference/index.md

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import {describe, expect, test} from 'vitest';
2-
import {isValidDate} from '../isValidDate';
1+
import { describe, expect, test } from 'vitest'
2+
import { isValidDate } from '../isValidDate'
33

44
describe('isValidDate', () => {
55
test('should return true for a valid date', () => {
6-
expect(isValidDate(new Date())).toBe(true);
6+
expect(isValidDate(new Date())).toBe(true)
77
})
88

99
test('should return false for an invalid date', () => {
10-
expect(isValidDate(new Date("invalid"))).toBe(false);
11-
});
10+
expect(isValidDate(new Date('invalid'))).toBe(false)
11+
})
1212

13-
test("should return false for null", () => {
14-
expect(isValidDate(null)).toBe(false);
15-
});
16-
});
13+
test('should return false for null', () => {
14+
expect(isValidDate(null)).toBe(false)
15+
})
16+
})

packages/time/src/formatter/shared.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ export interface TimeFormatterOptions extends LocaleFormatterOptions {
4141
}
4242

4343
export interface DateTimeFormatterOptions
44-
extends DateFormatterOptions,
45-
TimeFormatterOptions {}
44+
extends DateFormatterOptions, TimeFormatterOptions {}
4645

4746
export interface DateFormatterBuildParams {
4847
locale?: Locale

packages/time/src/polyfills/getWeekInfo.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
import type { WeekInfo } from "./types";
1+
import type { WeekInfo } from './types'
22

33
const normalizeLocale = (loc: string) => {
44
const [lang, region] = loc.split('-')
5-
return region ? `${lang?.toLowerCase()}-${region.toUpperCase()}` : lang?.toLowerCase()
5+
return region
6+
? `${lang?.toLowerCase()}-${region.toUpperCase()}`
7+
: lang?.toLowerCase()
68
}
79

810
;(function () {
9-
if ('weekInfo' in Intl.Locale.prototype && typeof Intl.Locale.prototype.getWeekInfo !== 'function') {
11+
if (
12+
'weekInfo' in Intl.Locale.prototype &&
13+
typeof Intl.Locale.prototype.getWeekInfo !== 'function'
14+
) {
1015
Intl.Locale.prototype.getWeekInfo = function () {
1116
return this.weekInfo
1217
}
@@ -26,13 +31,13 @@ const normalizeLocale = (loc: string) => {
2631
}
2732

2833
if (!match) {
29-
match = Object.entries(weekInfoData).find(([key]) =>
30-
normalizeLocale(key) === normalizedLocale
34+
match = Object.entries(weekInfoData).find(
35+
([key]) => normalizeLocale(key) === normalizedLocale,
3136
)?.[1]
3237
}
3338

3439
return match
3540
}
3641
})
3742
}
38-
})()
43+
})()

0 commit comments

Comments
 (0)