I am trying to add a column to my Grid, that has a countdown. My API gives me a UTC date, so I need to convert it to local time on the browser, then get the how long until it happens.
it looks like i can use this to get my date to local time (not sure if its working or not):
DataUtil.serverTimezoneOffset = new Date().getTimezoneOffset()/60;
And I can use this to get the countdown working:
import {VueCountdown} from '@chenfengyuan/vue-countdown';
components: {
VueCountdown
},
What I am not sure is how to hook that into a e-column (at the moment I am just displaying
HH:MM dd/MM/yyyy:
<ejs-grid :dataSource='data'>
<e-column field='regoExpires' headerText='Expires' type="dateTime" format="HH:MM dd/MM/yyyy" width=180></e-column>
<e-columns>
</ejs-grid>
My data from a WebApiAdapter:
return {
data: new DataManager({
url: 'http://example.com/api/v1/rego',
adaptor: new WebApiAdaptor(),
crossDomain: true,
offline: true
}),
thanks