AnsweredAssumed Answered

Need to return the date and time attributes without UTC conversion in dojox/grid/DataGrid

Question asked by gharlowe on Dec 5, 2014
Latest reply on Dec 12, 2014 by gharlowe

Hope someone can help me.  My web page is displaying data from a related table using dojox/grid/DataGrid.

 

I found a format script that formats it as an actual date and time:

 

//format the date and time that is used in the related table

function formatDate(value) {

     var inputDate = new Date(value);

     return dojo.date.locale.format(inputDate, { 

               selector: 'date',

               datePattern: 'MM/dd/yyyy'

     });

}

function formatTime(value) {

     var inputDate = new Date(value);

     return dojo.date.locale.format(inputDate, { 

               selector: 'time',

               timePattern: 'hh:mm a' 

     });

}

 

In my table I call it like this:

               <th width="100" field="StatusDate" formatter="formatDate"><em>Date</em></th>

              <th width="100" field="StatusTime" formatter="formatTime"><em>Time</em></th>

 

This works to get a readable date and time but it assumes it is UTC and the browser converts it to Mountain Standard Time (I am in Arizona).

 

Is there a way to prevent this so that it displays the date and time as they are in the attribute fields?

 

Thanks

 

Gwynn

Outcomes