aboutsummaryrefslogtreecommitdiffstats
path: root/core/src/OC/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/OC/util.js')
-rw-r--r--core/src/OC/util.js34
1 files changed, 8 insertions, 26 deletions
diff --git a/core/src/OC/util.js b/core/src/OC/util.js
index e1a2f8f0687..c46d9a141b1 100644
--- a/core/src/OC/util.js
+++ b/core/src/OC/util.js
@@ -1,30 +1,12 @@
/**
- * @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author John Molakvoæ <skjnldsv@protonmail.com>
- *
- * @license AGPL-3.0-or-later
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
import moment from 'moment'
-import History from './util-history'
-import OC from './index'
+import History from './util-history.js'
+import OC from './index.js'
import { formatFileSize as humanFileSize } from '@nextcloud/files'
/**
@@ -64,7 +46,7 @@ export default {
History,
/**
- * @deprecated use https://nextcloud.github.io/nextcloud-files/modules/_humanfilesize_.html#formatfilesize
+ * @deprecated use https://nextcloud.github.io/nextcloud-files/functions/formatFileSize.html
*/
humanFileSize,
@@ -73,7 +55,7 @@ export default {
* Makes 2kB to 2048.
* Inspired by computerFileSize in helper.php
*
- * @param {string} string file size in human readable format
+ * @param {string} string file size in human-readable format
* @return {number} or null if string could not be parsed
*
*
@@ -124,7 +106,7 @@ export default {
*/
formatDate(timestamp, format) {
if (window.TESTING === undefined) {
- console.warn('OC.Util.formatDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment')
+ OC.debug && 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)
@@ -136,7 +118,7 @@ export default {
*/
relativeModifiedDate(timestamp) {
if (window.TESTING === undefined) {
- console.warn('OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21. See @nextcloud/moment')
+ OC.debug && 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) {