File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -404,26 +404,35 @@ describe('dates', function() {
404404
405405 var unixIndex = dates . indexOf ( '1348-10-11' ) ;
406406
407+ var failed = [ ] ;
408+
407409 var tests = [ ] ;
408410 for ( var i = 0 ; i < dates . length ; i ++ ) {
409411 var date = dates [ i ] ;
410412 var parts = date . split ( '-' ) ;
411413 var d = + parts [ 2 ] ;
414+ var m = + parts [ 1 ] ;
412415
413- // only test days at the start/end of months
414- if ( d < 3 || d > 28 ) {
416+ if ( d === 1 && m === 1 ) {
415417 var time = ( i - unixIndex ) * 86400000 ;
416418
417419 tests . push ( [ date , time ] ) ;
418420 }
419421 }
420422
421- tests . forEach ( function ( v ) {
423+ tests . forEach ( function ( v , i ) {
422424 var calendar = 'persian' ;
423425 var dateStr = v [ 0 ] ;
424426 var ms = v [ 1 ] ;
425- expect ( Lib . ms2DateTime ( ms , 0 , calendar ) ) . toBe ( dateStr ) ;
426- expect ( Lib . dateTime2ms ( dateStr , calendar ) ) . toBe ( ms ) ;
427+ //expect(Lib.ms2DateTime(ms, 0, calendar)).toBe(dateStr);
428+ //expect(Lib.dateTime2ms(dateStr, calendar)).toBe(ms);
429+ if ( Lib . ms2DateTime ( ms , 0 , calendar ) !== dateStr ) {
430+ failed . push ( Lib . ms2DateTime ( ms , 0 , calendar ) + " | " + dateStr ) ;
431+ }
432+
433+ if ( i === tests . length - 1 ) {
434+ console . log ( JSON . stringify ( { failed : failed } ) ) ;
435+ }
427436 } ) ;
428437 } ) ;
429438 } ) ;
You can’t perform that action at this time.
0 commit comments