@@ -39,7 +39,9 @@ import {
3939 getNonStandardDateTimeFormatWarning ,
4040 getNonStandardFormatWarning ,
4141 getParsedRelativeDateStr ,
42- getPickerDateAndTimeFormat , getPickerFormatWithPrecision , getPickerTimeFormatWithPrecision ,
42+ getPickerDateAndTimeFormat ,
43+ getPickerFormatWithPrecision ,
44+ getPickerTimeFormatWithPrecision ,
4345 isDateBetween ,
4446 isDateTimeInPast ,
4547 isRelativeDateFilterValue ,
@@ -457,7 +459,6 @@ describe('Date Utilities', () => {
457459 dateFormat : 'HH:mm:ss.SSS' ,
458460 timeFormat : 'HH:mm:ss.SSS' ,
459461 } ) ;
460-
461462 } ) ;
462463
463464 test ( 'datePlaceholder without col.rangeURI' , ( ) => {
@@ -499,7 +500,6 @@ describe('Date Utilities', () => {
499500 timeFormat : undefined ,
500501 } ) ;
501502
502-
503503 const timeCol = new QueryColumn ( { shortCaption : 'TimeCol' , rangeURI : undefined } ) ;
504504 expect ( getColDateFormat ( timeCol , 'Time' ) ) . toBe ( 'HH:mm' ) ;
505505
@@ -522,7 +522,6 @@ describe('Date Utilities', () => {
522522 dateFormat : 'yyyy-MM-dd HH:mm:ss.SSS' ,
523523 timeFormat : 'HH:mm:ss.SSS' ,
524524 } ) ;
525-
526525 } ) ;
527526
528527 test ( 'queryColumn.format' , ( ) => {
@@ -793,9 +792,9 @@ describe('Date Utilities', () => {
793792
794793 describe ( 'getPickerTimeFormatWithPrecision' , ( ) => {
795794 test ( 'invalid' , ( ) => {
796- expect ( getPickerTimeFormatWithPrecision ( undefined ) ) . toBe ( '' )
797- expect ( getPickerTimeFormatWithPrecision ( null ) ) . toBe ( '' )
798- expect ( getPickerTimeFormatWithPrecision ( '' ) ) . toBe ( '' )
795+ expect ( getPickerTimeFormatWithPrecision ( undefined ) ) . toBe ( '' ) ;
796+ expect ( getPickerTimeFormatWithPrecision ( null ) ) . toBe ( '' ) ;
797+ expect ( getPickerTimeFormatWithPrecision ( '' ) ) . toBe ( '' ) ;
799798 expect ( getPickerTimeFormatWithPrecision ( 'null' ) ) . toBe ( 'null' ) ;
800799 } ) ;
801800
@@ -815,7 +814,7 @@ describe('Date Utilities', () => {
815814 } ) ;
816815
817816 test ( 'am/pm' , ( ) => {
818- expect ( getPickerTimeFormatWithPrecision ( 'hh:mm:ss.SSS a' ) ) . toBe ( 'hh:mm:ss.SSS a' )
817+ expect ( getPickerTimeFormatWithPrecision ( 'hh:mm:ss.SSS a' ) ) . toBe ( 'hh:mm:ss.SSS a' ) ;
819818 expect ( getPickerTimeFormatWithPrecision ( 'hh:mm:ss.SSS a' , true , false , false ) ) . toBe ( 'hh:mm:ss.SSS a' ) ;
820819 expect ( getPickerTimeFormatWithPrecision ( 'hh:mm:ss.SSS a' , false , true , false ) ) . toBe ( 'hh:mm:ss.SSS a' ) ;
821820 expect ( getPickerTimeFormatWithPrecision ( 'hh:mm:ss.SSS a' , false , false , true ) ) . toBe ( 'hh:mm:ss.SSS a' ) ;
@@ -832,38 +831,62 @@ describe('Date Utilities', () => {
832831
833832 describe ( 'getPickerFormatWithPrecision' , ( ) => {
834833 test ( 'invalid' , ( ) => {
835- expect ( getPickerFormatWithPrecision ( undefined ) ) . toBe ( '' )
836- expect ( getPickerFormatWithPrecision ( null ) ) . toBe ( '' )
837- expect ( getPickerFormatWithPrecision ( '' ) ) . toBe ( '' )
834+ expect ( getPickerFormatWithPrecision ( undefined ) ) . toBe ( '' ) ;
835+ expect ( getPickerFormatWithPrecision ( null ) ) . toBe ( '' ) ;
836+ expect ( getPickerFormatWithPrecision ( '' ) ) . toBe ( '' ) ;
838837 expect ( getPickerFormatWithPrecision ( 'null' ) ) . toBe ( 'null' ) ;
839838 } ) ;
840839
841840 test ( 'Date only' , ( ) => {
842- expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd' ) ) . toBe ( 'yyyy-MM-dd' )
843- expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy' ) ) . toBe ( 'MMMM dd yyyy' )
841+ expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd' ) ) . toBe ( 'yyyy-MM-dd' ) ;
842+ expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy' ) ) . toBe ( 'MMMM dd yyyy' ) ;
844843 } ) ;
845844
846845 test ( 'Datetime' , ( ) => {
847846 expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd HH:mm:ss.SSS' ) ) . toBe ( 'yyyy-MM-dd HH:mm:ss.SSS' ) ;
848847 expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy HH:mm:ss.SSS' ) ) . toBe ( 'MMMM dd yyyy HH:mm:ss.SSS' ) ;
849- expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd HH:mm:ss.SSS' , true , false , false ) ) . toBe ( 'yyyy-MM-dd HH:mm:ss.SSS' ) ;
850- expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy HH:mm:ss.SSS' , true , false , false ) ) . toBe ( 'MMMM dd yyyy HH:mm:ss.SSS' ) ;
848+ expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd HH:mm:ss.SSS' , true , false , false ) ) . toBe (
849+ 'yyyy-MM-dd HH:mm:ss.SSS'
850+ ) ;
851+ expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy HH:mm:ss.SSS' , true , false , false ) ) . toBe (
852+ 'MMMM dd yyyy HH:mm:ss.SSS'
853+ ) ;
851854 expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd HH:mm:ss' ) ) . toBe ( 'yyyy-MM-dd HH:mm:ss' ) ;
852855 expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy HH:mm:ss' ) ) . toBe ( 'MMMM dd yyyy HH:mm:ss' ) ;
853- expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd HH:mm:ss' , false , false , true ) ) . toBe ( 'yyyy-MM-dd HH:mm:ss.SSS' ) ;
854- expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy HH:mm:ss' , false , false , true ) ) . toBe ( 'MMMM dd yyyy HH:mm:ss.SSS' ) ;
856+ expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd HH:mm:ss' , false , false , true ) ) . toBe (
857+ 'yyyy-MM-dd HH:mm:ss.SSS'
858+ ) ;
859+ expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy HH:mm:ss' , false , false , true ) ) . toBe (
860+ 'MMMM dd yyyy HH:mm:ss.SSS'
861+ ) ;
855862 expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd HH:mm' , false , true , false ) ) . toBe ( 'yyyy-MM-dd HH:mm:ss' ) ;
856- expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy HH:mm' , false , true , false ) ) . toBe ( 'MMMM dd yyyy HH:mm:ss' ) ;
857- expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd HH:mm' , false , false , true ) ) . toBe ( 'yyyy-MM-dd HH:mm:ss.SSS' ) ;
858- expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy HH:mm' , false , false , true ) ) . toBe ( 'MMMM dd yyyy HH:mm:ss.SSS' ) ;
859- expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy hh:mm:ss.SSS a' ) ) . toBe ( 'MMMM dd yyyy hh:mm:ss.SSS a' )
860- expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd hh:mm:ss.SSS a' , true , false , false ) ) . toBe ( 'yyyy-MM-dd hh:mm:ss.SSS a' ) ;
861- expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd hh:mm:ss a' , false , false , true ) ) . toBe ( 'yyyy-MM-dd hh:mm:ss.SSS a' ) ;
862- expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy hh:mm:ss a' , false , false , true ) ) . toBe ( 'MMMM dd yyyy hh:mm:ss.SSS a' ) ;
863+ expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy HH:mm' , false , true , false ) ) . toBe (
864+ 'MMMM dd yyyy HH:mm:ss'
865+ ) ;
866+ expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd HH:mm' , false , false , true ) ) . toBe (
867+ 'yyyy-MM-dd HH:mm:ss.SSS'
868+ ) ;
869+ expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy HH:mm' , false , false , true ) ) . toBe (
870+ 'MMMM dd yyyy HH:mm:ss.SSS'
871+ ) ;
872+ expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy hh:mm:ss.SSS a' ) ) . toBe ( 'MMMM dd yyyy hh:mm:ss.SSS a' ) ;
873+ expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd hh:mm:ss.SSS a' , true , false , false ) ) . toBe (
874+ 'yyyy-MM-dd hh:mm:ss.SSS a'
875+ ) ;
876+ expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd hh:mm:ss a' , false , false , true ) ) . toBe (
877+ 'yyyy-MM-dd hh:mm:ss.SSS a'
878+ ) ;
879+ expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy hh:mm:ss a' , false , false , true ) ) . toBe (
880+ 'MMMM dd yyyy hh:mm:ss.SSS a'
881+ ) ;
863882 expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy hh:mm a' ) ) . toBe ( 'MMMM dd yyyy hh:mm a' ) ;
864883 expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd hh:mm a' , true , false , false ) ) . toBe ( 'yyyy-MM-dd hh:mm a' ) ;
865- expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd hh:mm a' , false , true , false ) ) . toBe ( 'yyyy-MM-dd hh:mm:ss a' ) ;
866- expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy hh:mm a' , false , false , true ) ) . toBe ( 'MMMM dd yyyy hh:mm:ss.SSS a' ) ;
884+ expect ( getPickerFormatWithPrecision ( 'yyyy-MM-dd hh:mm a' , false , true , false ) ) . toBe (
885+ 'yyyy-MM-dd hh:mm:ss a'
886+ ) ;
887+ expect ( getPickerFormatWithPrecision ( 'MMMM dd yyyy hh:mm a' , false , false , true ) ) . toBe (
888+ 'MMMM dd yyyy hh:mm:ss.SSS a'
889+ ) ;
867890 } ) ;
868891 } ) ;
869892
0 commit comments