@@ -262,9 +262,9 @@ define(function (require, exports, module) {
262262 } ) ;
263263
264264 it ( "should use formatted date without year for dates earlier this year" , function ( ) {
265- const now = new Date ( ) ;
266- const testDate = new Date ( now . getFullYear ( ) , 1 , 15 ) ; // Feb 15 of current year
267- const result = LocalizationUtils . dateTimeFromNowFriendly ( testDate , "en" ) ;
265+ const testDate = new Date ( 2024 , 1 , 15 ) ;
266+ const fromDate = new Date ( 2024 , 11 , 15 ) ;
267+ const result = LocalizationUtils . dateTimeFromNowFriendly ( testDate , "en" , fromDate ) ;
268268 expect ( result ) . toBe ( "Feb 15" ) ;
269269 } ) ;
270270
@@ -301,9 +301,9 @@ define(function (require, exports, module) {
301301
302302 // Current year tests
303303 it ( "should use formatted date without year for dates earlier this year (de locale)" , function ( ) {
304- const now = new Date ( ) ;
305- const testDate = new Date ( now . getFullYear ( ) , 1 , 15 ) ; // Feb 15 of current year
306- const result = LocalizationUtils . dateTimeFromNowFriendly ( testDate , "de" ) ;
304+ const testDate = new Date ( 2024 , 1 , 15 ) ;
305+ const fromDate = new Date ( 2024 , 10 , 15 ) ;
306+ const result = LocalizationUtils . dateTimeFromNowFriendly ( testDate , "de" , fromDate ) ;
307307 expect ( result ) . toBe ( "15. Feb." ) ;
308308 } ) ;
309309
@@ -322,4 +322,4 @@ define(function (require, exports, module) {
322322 } ) ;
323323
324324 } ) ;
325- } ) ;
325+ } ) ;
0 commit comments