Skip to content
Snippets Groups Projects
Commit aa766c87 authored by Martin Schoeler's avatar Martin Schoeler
Browse files

added date for attachments

attachments older than the current day
parent 79ea7f1c
No related branches found
No related tags found
No related merge requests found
......@@ -908,7 +908,9 @@
"Message_ShowFormattingTips": "Show Formatting Tips",
"Message_starring": "Message starring",
"Message_TimeFormat": "Time Format",
"Message_TimeAndDateFormat": "Time and Date Format",
"Message_TimeFormat_Description": "See also: <a href=\"http://momentjs.com/docs/#/displaying/format/\" target=\"momemt\">Moment.js</a>",
"Message_TimeAndDateFormat_Description": "See also: <a href=\"http://momentjs.com/docs/#/displaying/format/\" target=\"momemt\">Moment.js</a>",
"Message_too_long": "Message too long",
"Message_VideoRecorderEnabled": "Video Recorder Enabled",
"Message_VideoRecorderEnabledDescription": "Requires 'video/webm' files to be an accepted media type within 'File Upload' settings.",
......
......@@ -202,6 +202,7 @@ RocketChat.settings.addGroup 'Message', ->
@add 'API_EmbedSafePorts', '80, 443', { type: 'string' }
@add 'Message_TimeFormat', 'LT', { type: 'string', public: true, i18nDescription: 'Message_TimeFormat_Description' }
@add 'Message_DateFormat', 'LL', { type: 'string', public: true, i18nDescription: 'Message_DateFormat_Description' }
@add 'Message_TimeAndDateFormat', 'LLL', { type: 'string', public: true, i18nDescription: 'Message_TimeAndDateFormat_Description' }
@add 'Message_HideType_uj', false, { type: 'boolean', public: true }
@add 'Message_HideType_ul', false, { type: 'boolean', public: true }
@add 'Message_HideType_ru', false, { type: 'boolean', public: true }
......
......@@ -49,7 +49,10 @@ Template.messageAttachment.helpers
return Meteor.user()?.settings?.preferences?.collapseMediaByDefault is true
time: ->
return moment(@ts).format(RocketChat.settings.get('Message_TimeFormat'))
if moment(@ts).format(RocketChat.settings.get('Message_DateFormat')) == moment(Date.now()).format(RocketChat.settings.get('Message_DateFormat'))
return moment(@ts).format(RocketChat.settings.get('Message_TimeFormat'))
else
return moment(@ts).format(RocketChat.settings.get('Message_TimeAndDateFormat'))
injectIndex: (data, previousIndex, index) ->
data.index = previousIndex + '.attachments.' + index
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment