mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Added year/y to date math parser
This commit is contained in:
parent
18ee2fabcf
commit
4e6bc71f49
@ -316,6 +316,15 @@ function($, _, moment) {
|
||||
}
|
||||
unit = mathString.charAt(i++);
|
||||
switch (unit) {
|
||||
case 'y':
|
||||
if (type === 0) {
|
||||
roundUp ? dateTime.endOf('year') : dateTime.startOf('year');
|
||||
} else if (type === 1) {
|
||||
dateTime.add('years',num);
|
||||
} else if (type === 2) {
|
||||
dateTime.subtract('years',num);
|
||||
}
|
||||
break;
|
||||
case 'M':
|
||||
if (type === 0) {
|
||||
roundUp ? dateTime.endOf('month') : dateTime.startOf('month');
|
||||
|
Loading…
Reference in New Issue
Block a user