@@ -14,3 +14,77 @@ test("PlainTime", () => {
14
14
Temporal . PlainTime . from ( "12:00:00" ) ,
15
15
) ;
16
16
} ) ;
17
+
18
+ test ( "ZonedDateTime without offset transition" , ( ) => {
19
+ expect (
20
+ startOfHour (
21
+ Temporal . ZonedDateTime . from (
22
+ "2024-01-01T01:23:45.678901234+09:00[Asia/Tokyo]" ,
23
+ ) ,
24
+ ) ,
25
+ ) . toEqual (
26
+ Temporal . ZonedDateTime . from ( "2024-01-01T01:00:00+09:00[Asia/Tokyo]" ) ,
27
+ ) ;
28
+ } ) ;
29
+
30
+ test ( "ZonedDateTime and backward transition" , ( ) => {
31
+ expect (
32
+ startOfHour (
33
+ Temporal . ZonedDateTime . from (
34
+ "2023-04-02T01:45:00+10:30[Australia/Lord_Howe]" ,
35
+ ) ,
36
+ ) ,
37
+ ) . toEqual (
38
+ Temporal . ZonedDateTime . from (
39
+ "2023-04-02T01:00:00+11:00[Australia/Lord_Howe]" ,
40
+ ) ,
41
+ ) ;
42
+ expect (
43
+ startOfHour (
44
+ Temporal . ZonedDateTime . from (
45
+ "1945-09-11T23:30:00+07:30[Asia/Kuala_Lumpur]" ,
46
+ ) ,
47
+ ) ,
48
+ ) . toEqual (
49
+ Temporal . ZonedDateTime . from ( "1945-09-11T23:00:00+09:00[Asia/Kuala_Lumpur]" ) ,
50
+ ) ;
51
+ expect (
52
+ startOfHour (
53
+ Temporal . ZonedDateTime . from (
54
+ "2010-11-07T00:30:00-03:30[America/St_Johns]" ,
55
+ ) ,
56
+ ) ,
57
+ ) . toEqual (
58
+ Temporal . ZonedDateTime . from ( "2010-11-07T00:00:00-02:30[America/St_Johns]" ) ,
59
+ ) ;
60
+ expect (
61
+ startOfHour (
62
+ Temporal . ZonedDateTime . from (
63
+ "1944-09-10T02:30:00-04:00[America/Barbados]" ,
64
+ ) ,
65
+ ) ,
66
+ ) . toEqual (
67
+ Temporal . ZonedDateTime . from ( "1944-09-10T02:00:00-03:30[America/Barbados]" ) ,
68
+ ) ;
69
+ } ) ;
70
+
71
+ test ( "ZonedDateTime and forward transition" , ( ) => {
72
+ expect (
73
+ startOfHour (
74
+ Temporal . ZonedDateTime . from (
75
+ "1984-10-01T00:45:00-03:00[America/Paramaribo]" ,
76
+ ) ,
77
+ ) ,
78
+ ) . toEqual (
79
+ Temporal . ZonedDateTime . from (
80
+ "1984-10-01T00:30:00-03:00[America/Paramaribo]" ,
81
+ ) ,
82
+ ) ;
83
+ expect (
84
+ startOfHour (
85
+ Temporal . ZonedDateTime . from ( "1919-03-31T00:45:00-04:00[America/Toronto]" ) ,
86
+ ) ,
87
+ ) . toEqual (
88
+ Temporal . ZonedDateTime . from ( "1919-03-31T00:30:00-04:00[America/Toronto]" ) ,
89
+ ) ;
90
+ } ) ;
0 commit comments