utcOffset in Popup Template

707
2
Jump to solution
10-16-2014 10:13 AM
Highlighted
Occasional Contributor II

So I have a popup template that is referencing a date field that is not stored in UTC so by default the popup converts what it thinks is UTC to our time zone. However the date field is already stored in our local time so I need to specify the UTC offset manually. I see there is a way to do this in the API docs for popuptemplate and it is called utcOffset however it is not clear on where exactly to put it.  I have tried various places but have not been successful. Any help would be greatly appreciated.

var template = new PopupTemplate({

            title: "Incident",

            fieldInfos: [{

                fieldName: "alarmdate",

                label: "Alarm Date:",

                visible: true

            }, {

                fieldName: "incidentnumber",

                label: "Inc. #:",

                visible: true

            }, {

                fieldName: "CallCode",

                label: "Call Code:",

                visible: true

            }, {

                fieldName: "compositeaddress",

                label: "Address:",

                visible: true

            },{

                fieldName: "Units",

                label: "Unit(s):",

                visible: true

            }],

            showAttachments: true

        });

The alarmdate field is the one I am trying to add the utcOffset to I would need it to be something like +7.

Thanks,

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Occasional Contributor

have you tried this?

var template = new PopupTemplate({ 

title: "Incident",

fieldInfos: [{

...

}],

showAttachments: true

  },{utcOffset: 300});

View solution in original post

Reply
0 Kudos
2 Replies
Highlighted
Occasional Contributor

have you tried this?

var template = new PopupTemplate({ 

title: "Incident",

fieldInfos: [{

...

}],

showAttachments: true

  },{utcOffset: 300});

View solution in original post

Reply
0 Kudos
Highlighted
Occasional Contributor II

This worked thank you for your help!