feat(timepicker2): added date math tests

This commit is contained in:
Torkel Ödegaard
2015-09-16 18:48:41 +02:00
parent 3912eb7b26
commit d705108be5
14 changed files with 7494 additions and 74 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ var unitsDesc = unitsAsc.reverse();
export class DateMath {
static parse(text, roundUp) {
static parse(text, roundUp?) {
if (!text) { return undefined; }
if (moment.isMoment(text)) { return text; }
if (_.isDate(text)) { return moment(text); }
@@ -44,7 +44,7 @@ export class DateMath {
return DateMath.parseDateMath(mathString, time, roundUp);
}
static parseDateMath(mathString, time, roundUp) {
static parseDateMath(mathString, time, roundUp?) {
var dateTime = time;
var i = 0;
var len = mathString.length;