@@ -24,6 +24,36 @@ test("Test - Time expression", function () {
24
24
} ) ;
25
25
} ) ;
26
26
27
+ test ( "Test - Time expression after date" , function ( ) {
28
+ testSingleCase ( chrono , "05/31/2024 14:15" , new Date ( 2016 , 10 - 1 , 1 , 8 ) , ( result , text ) => {
29
+ expect ( result . text ) . toBe ( text ) ;
30
+ expect ( result . start . get ( "hour" ) ) . toBe ( 14 ) ;
31
+ expect ( result . start . get ( "minute" ) ) . toBe ( 15 ) ;
32
+ expect ( result . start . get ( "meridiem" ) ) . toBe ( Meridiem . PM ) ;
33
+ } ) ;
34
+
35
+ testSingleCase ( chrono , "05/31/2024.14:15" , new Date ( 2016 , 10 - 1 , 1 , 8 ) , ( result , text ) => {
36
+ expect ( result . text ) . toBe ( text ) ;
37
+ expect ( result . start . get ( "hour" ) ) . toBe ( 14 ) ;
38
+ expect ( result . start . get ( "minute" ) ) . toBe ( 15 ) ;
39
+ expect ( result . start . get ( "meridiem" ) ) . toBe ( Meridiem . PM ) ;
40
+ } ) ;
41
+
42
+ testSingleCase ( chrono , "05/31/2024:14:15" , new Date ( 2016 , 10 - 1 , 1 , 8 ) , ( result , text ) => {
43
+ expect ( result . text ) . toBe ( text ) ;
44
+ expect ( result . start . get ( "hour" ) ) . toBe ( 14 ) ;
45
+ expect ( result . start . get ( "minute" ) ) . toBe ( 15 ) ;
46
+ expect ( result . start . get ( "meridiem" ) ) . toBe ( Meridiem . PM ) ;
47
+ } ) ;
48
+
49
+ testSingleCase ( chrono , "05/31/2024-14:15" , new Date ( 2016 , 10 - 1 , 1 , 8 ) , ( result , text ) => {
50
+ expect ( result . text ) . toBe ( text ) ;
51
+ expect ( result . start . get ( "hour" ) ) . toBe ( 14 ) ;
52
+ expect ( result . start . get ( "minute" ) ) . toBe ( 15 ) ;
53
+ expect ( result . start . get ( "meridiem" ) ) . toBe ( Meridiem . PM ) ;
54
+ } ) ;
55
+ } ) ;
56
+
27
57
test ( "Test - Time range expression" , function ( ) {
28
58
testSingleCase ( chrono , "10:00:00 - 21:45:00" , new Date ( 2016 , 10 - 1 , 1 , 8 ) , ( result , text ) => {
29
59
expect ( result . text ) . toBe ( text ) ;
0 commit comments