fulcrumapp / fulcrum-expressions

Fulcrum expressions engine
http://developer.fulcrumapp.com/expressions/intro/
5 stars 0 forks source link

DATEADD() does not account for daylight savings #36

Open AHelms opened 5 years ago

AHelms commented 5 years ago

If you use DATEADD() to add/subtract from a date and there is a time change (daylight savings) between the input date and returned data then there is a chance that the returned date will be off by a day.

This was discovered when using DATEADD($date, -6) where $date was 2019-03-13, the returned date was 2019-03-06 when it should be 2019-03-07. Daylight savings started on 2019-03-10.

tylerjohnst commented 5 years ago

A total hacky solution might be to add 12 extra hours here: https://github.com/fulcrumapp/fulcrum-expressions/blob/master/functions.coffee#L277