diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-11-10 11:34:12 +0100 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-11-10 12:10:01 +0100 |
commit | 5848c31fa20bd2b8f6a9e62e4fdf31d99fb481c1 (patch) | |
tree | 4476cab4b8c690f177817326da1277e97d8af650 /core/src/OC/util.js | |
parent | 78e1f228933ca3b67a628deff532704d6c7caba8 (diff) | |
download | nextcloud-server-5848c31fa20bd2b8f6a9e62e4fdf31d99fb481c1.tar.gz nextcloud-server-5848c31fa20bd2b8f6a9e62e4fdf31d99fb481c1.zip |
Do not print deprecation warnings during testing
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/src/OC/util.js')
-rw-r--r-- | core/src/OC/util.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/OC/util.js b/core/src/OC/util.js index 5908d9f6e1f..611c42d317f 100644 --- a/core/src/OC/util.js +++ b/core/src/OC/util.js @@ -117,7 +117,9 @@ export default { * @returns {string} timestamp formatted as requested */ formatDate(timestamp, format) { - console.warn('OC.Util.formatDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment') + if (window.TESTING === undefined) { + console.warn('OC.Util.formatDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment') + } format = format || 'LLL' return moment(timestamp).format(format) }, @@ -127,7 +129,9 @@ export default { * @returns {string} human readable difference from now */ relativeModifiedDate(timestamp) { - console.warn('OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment') + if (window.TESTING === undefined) { + console.warn('OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment') + } const diff = moment().diff(moment(timestamp)) if (diff >= 0 && diff < 45000) { return t('core', 'seconds ago') |