diff options
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index 4a9a5ce82ff..5c9d7bf0141 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1353,6 +1353,18 @@ OC.Util = { } }); }); + }, + + /** + * Remove the time component from a given date + * + * @param {Date} date date + * @return {Date} date with stripped time + */ + stripTime: function(date) { + // FIXME: likely to break when crossing DST + // would be better to use a library like momentJS + return new Date(date.getFullYear(), date.getMonth(), date.getDate()); } }; |