@@ -30,6 +30,7 @@ import {DataTypeFormatter} from '../../../../services/formatters/data-type.forma
3030import { DatetimeFormatter } from '../../../../services/formatters/datetime/datetime-formatter.service' ;
3131import { FieldLogicManager } from '../../../field-logic/field-logic.manager' ;
3232import { FieldLogicDisplayManager } from '../../../field-logic-display/field-logic-display.manager' ;
33+ import { UserPreferenceStore } from "../../../../store/user-preference/user-preference.store" ;
3334
3435@Component ( {
3536 selector : 'scrm-datetime-detail' ,
@@ -43,7 +44,8 @@ export class DateTimeDetailFieldComponent extends BaseDateTimeComponent{
4344 protected formatter : DatetimeFormatter ,
4445 protected typeFormatter : DataTypeFormatter ,
4546 protected logic : FieldLogicManager ,
46- protected logicDisplay : FieldLogicDisplayManager
47+ protected logicDisplay : FieldLogicDisplayManager ,
48+ protected preferences : UserPreferenceStore
4749 ) {
4850 super ( formatter , typeFormatter , logic , logicDisplay ) ;
4951 }
@@ -52,9 +54,18 @@ export class DateTimeDetailFieldComponent extends BaseDateTimeComponent{
5254 return this . formatter . userTimeZone ( ) ;
5355 }
5456
55- toDateTime ( dateString : string ) : Date {
56- return this . formatter . toDateTime ( dateString , this . formatter . getInternalFormat ( ) , {
57- zone : 'GMT'
58- } ) . toJSDate ( ) ;
57+ getLocale ( ) : string {
58+ return this . formatter . locale ;
5959 }
60+
61+ toDateTime ( dateString : string ) {
62+ const options = {
63+ fromFormat : this . formatter . getInternalFormat ( ) ,
64+ toFormat : this . formatter . getUserFormat ( )
65+ }
66+
67+ return this . formatter . toUserFormat ( dateString , options ) ;
68+ }
69+
70+
6071}
0 commit comments