Skip to content

Commit

Permalink
Deprectae OC.Util.formatDate and OC.Util.relativeModifiedDate
Browse files Browse the repository at this point in the history
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
  • Loading branch information
rullzer committed May 15, 2020
1 parent d132f81 commit bf4ce86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/src/OC/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export default {
* @returns {string} timestamp formatted as requested
*/
formatDate: function(timestamp, format) {
console.warn('OC.Util.formatDate is deprecated and will be removed in Nextcloud 21')
format = format || 'LLL'
return moment(timestamp).format(format)
},
Expand All @@ -123,6 +124,7 @@ export default {
* @returns {string} human readable difference from now
*/
relativeModifiedDate: function(timestamp) {
console.warn('OC.Util.relativeModifiedDate is deprecated and will be removed in Nextcloud 21')
const diff = moment().diff(moment(timestamp))
if (diff >= 0 && diff < 45000) {
return t('core', 'seconds ago')
Expand Down

0 comments on commit bf4ce86

Please sign in to comment.