summaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2014-07-28 17:58:26 +0200
committerBjörn Schießle <schiessle@owncloud.com>2014-07-28 17:58:26 +0200
commit0dc649f3914c4917cbc679827fb4f080e4679b35 (patch)
tree57833e68b2baa456d922d86fd7bb1f4e778094b4 /core/js/js.js
parentc53b56e3139e517af4bca2aca631f625f435f74e (diff)
parent4fea52110265617b971f848475ed9e94ffa068d8 (diff)
downloadnextcloud-server-0dc649f3914c4917cbc679827fb4f080e4679b35.tar.gz
nextcloud-server-0dc649f3914c4917cbc679827fb4f080e4679b35.zip
Merge pull request #9758 from owncloud/share-expdatefix
Fix enforced share expiration date to be based on share time
Diffstat (limited to 'core/js/js.js')
-rw-r--r--core/js/js.js12
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());
}
};