Skip to content

Commit 521c871

Browse files
committed
use the proper format in timelines instead of printing a unix timestamp
1 parent 8d1f2e8 commit 521c871

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

js/src/timelines.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,19 @@ var dtf = require("./dateformat.js");
197197
{title:"User", field:"userUid", widthGrow:1}, //column will be allocated 1/5 of the remaining space
198198
{title:"Project", field:"project", widthGrow:1}, //column will be allocated 1/5 of the remaining space
199199
{title:"Client", field:"client", widthGrow:1}, //column will be allocated 1/5 of the remaining space
200-
{title:"When", field:"time", widthGrow:1}, //column will be allocated 1/5 of the remaining space
200+
{title:"When", field:"time", widthGrow:1,formatter:function(cell, formatterParams, onRendered){
201+
var t = cell.getValue();
202+
switch(group3) {
203+
case 'day':
204+
return moment.unix(t).format(dtf.dformat());
205+
case 'month':
206+
return moment(t).format(dtf.mformat());
207+
case '':
208+
return moment.unix(t).format(dtf.dtformat());
209+
default:
210+
return t;
211+
}
212+
}},
201213
{title:"Total Duration", field:"totalDuration",formatter:function(cell, formatterParams, onRendered){
202214
//cell - the cell component
203215
//formatterParams - parameters set for the column

0 commit comments

Comments
 (0)