File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,23 @@ export const computedSegmentedLink = function(property) {
47
47
export const computedDateTimeSplit = function ( property , segmentFormat , endProperty ) {
48
48
return computed ( property , {
49
49
get ( ) {
50
- return moment ( this . get ( property ) ) . format ( getFormat ( segmentFormat ) ) ;
50
+ let momentDate = moment ( this . get ( property ) ) ;
51
+ if ( this . constructor . modelName === 'event' ) {
52
+ momentDate = momentDate . tz ( this . timezone ) ;
53
+ }
54
+ return momentDate . format ( getFormat ( segmentFormat ) ) ;
51
55
} ,
52
56
set ( key , value ) {
53
- const newDate = moment ( value , getFormat ( segmentFormat ) ) ;
57
+ let newDate = moment ( value , getFormat ( segmentFormat ) ) ;
58
+ if ( this . constructor . modelName === 'event' ) {
59
+ newDate = newDate . tz ( this . timezone , true ) ;
60
+ }
54
61
let oldDate = newDate ;
55
62
if ( this . get ( property ) ) {
56
63
oldDate = moment ( this . get ( property ) , segmentFormat === 'date' ? FORM_DATE_FORMAT : FORM_TIME_FORMAT ) ;
64
+ if ( this . constructor . modelName === 'event' ) {
65
+ oldDate = oldDate . tz ( this . timezone , true ) ;
66
+ }
57
67
} else {
58
68
oldDate = newDate ;
59
69
}
You can’t perform that action at this time.
0 commit comments