Skip to content
Snippets Groups Projects
Commit edb64fef authored by benjamin's avatar benjamin
Browse files

ChartKit - add week as a date rounding option

parent b7edc0f5
Branches
Tags
No related merge requests found
......@@ -55,6 +55,10 @@
key: 'month',
label: ts('Month'),
},
{
key: 'week',
label: ts('Week'),
},
{
key: 'day',
label: ts('Day'),
......
......@@ -108,6 +108,9 @@
case 'month':
value = d3.timeMonth.floor(Date.parse(value)).valueOf();
break;
case 'week':
value = d3.timeWeek.floor(Date.parse(value)).valueOf();
break;
case 'day':
value = d3.timeDay.floor(Date.parse(value)).valueOf();
break;
......@@ -536,8 +539,10 @@
case 'month':
value = new Date(value).toLocaleString(undefined, {year: 'numeric', month: 'long'});
break;
case 'week':
value = new Date(value).toLocaleString(undefined, {year: 'numeric', month: 'long', day: 'numeric'});
break;
case 'day':
//value = (new Date(value)).toLocaleDateString();
value = new Date(value).toLocaleString(undefined, {year: 'numeric', month: 'long', day: 'numeric'});
break;
case 'hour':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment