@@ -13,7 +13,7 @@ import { ComponentMapperComponent } from '../../../_bridge/component-mapper/comp
1313import { dateFormatInfoDefault , getDateFormatInfo } from '../../../_helpers/date-format-utils' ;
1414import { PConnFieldProps } from '../../../_types/PConnProps.interface' ;
1515import { handleEvent } from '../../../_helpers/event-util' ;
16- import { format } from '../../../_helpers/formatters' ;
16+ import { format , convertToTimezone } from '../../../_helpers/formatters' ;
1717
1818interface DateTimeProps extends PConnFieldProps {
1919 // If any, enter additional props that only exist on DateTime here
@@ -92,7 +92,7 @@ export class DateTimeComponent implements OnInit, OnDestroy {
9292 this . formGroup$ . addControl ( this . controlName$ , this . fieldControl ) ;
9393 let dateTimeValue = this . value$ ?? '' ;
9494 if ( this . value$ ) {
95- dateTimeValue = dayjs ( format ( this . value$ , 'convertToTimezone' , { timezone : this . timezone } ) ) ?. toISOString ( ) ;
95+ dateTimeValue = dayjs ( convertToTimezone ( this . value$ , { timezone : this . timezone } ) ) ?. toISOString ( ) ;
9696 }
9797 this . fieldControl . setValue ( dateTimeValue ) ;
9898 this . bHasForm$ = true ;
@@ -140,7 +140,7 @@ export class DateTimeComponent implements OnInit, OnDestroy {
140140 this . value$ = this . configProps$ ?. value ;
141141 let dateTimeValue = this . configProps$ ?. value ?? '' ;
142142 if ( this . value$ ) {
143- dateTimeValue = dayjs ( format ( this . value$ , 'convertToTimezone' , { timezone : this . timezone } ) ) ?. toISOString ( ) ;
143+ dateTimeValue = dayjs ( convertToTimezone ( this . value$ , { timezone : this . timezone } ) ) ?. toISOString ( ) ;
144144 }
145145 this . fieldControl . setValue ( dateTimeValue ) ;
146146 // timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
0 commit comments