Open ghost opened 8 years ago
You can define your custom functions for it:
let filter = compileExpression(
'"31.07." + (month(myDate) <= 7 ? year(myDate) + 3 : year(myDate) + 4)',
{
month: date => date.getMonth(),
year: date => date.getFullYear()
}
);
filter({myDate: new Date()});
@joewalnes Close this?
I need your library for parsing expressions but I saw that it only supports numbers and strings. Is it possible to somehow allow date manipulation? The expression I need to parse is:
'31.07.' + (myDate.getMonth() <= 7 ? myDate.getFullYear() + 3: myDate.getFullYear() + 4 )