diff options
author | Stan Hu <stanhu@gmail.com> | 2017-07-20 01:50:38 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-07-20 01:50:38 +0300 |
commit | 9d03637307212856e9f52a0c097aa8a6bff35ea1 (patch) | |
tree | 5000d2002821b20ca1d69aa23ee739435da20c81 /app/assets/javascripts/lib | |
parent | d96b14f80a2fb285f2128aabeacc98fbe1f31dc8 (diff) | |
parent | 9a303fb7e889783c347778e67e2f6d15a330f418 (diff) |
Merge branch 'fix-date-off-by-1' into 'master'
Fix date bug in JS that makes dates not work with strings
Closes #29916
See merge request !12147
Diffstat (limited to 'app/assets/javascripts/lib')
-rw-r--r-- | app/assets/javascripts/lib/utils/datefix.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/datefix.js b/app/assets/javascripts/lib/utils/datefix.js new file mode 100644 index 00000000000..990dc3f6d1a --- /dev/null +++ b/app/assets/javascripts/lib/utils/datefix.js @@ -0,0 +1,8 @@ +const DateFix = { + dashedFix(val) { + const [y, m, d] = val.split('-'); + return new Date(y, m - 1, d); + }, +}; + +export default DateFix; |