diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-07-14 16:05:46 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-07-21 15:01:20 +0200 |
commit | 4fea52110265617b971f848475ed9e94ffa068d8 (patch) | |
tree | 30ab24ece6bfec0bde8d55ca9e59289079e1e12a /core/js/js.js | |
parent | 61598e7bb51de58bf48fa4e1b358440ac8cf1774 (diff) | |
download | nextcloud-server-4fea52110265617b971f848475ed9e94ffa068d8.tar.gz nextcloud-server-4fea52110265617b971f848475ed9e94ffa068d8.zip |
Fix enforced share expiration date to be based on share time
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()); } }; |