Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add date/time format settings #2852

Merged
merged 1 commit into from Apr 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/rocketchat-lib/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@
"Message_AllowStarring" : "Allow Message Starring",
"Message_AudioRecorderEnabled" : "Audio Recorder Enabled",
"Message_AudioRecorderEnabledDescription" : "Requires 'audio/wav' files to be an accepted media type within 'File Upload' settings.",
"Message_DateFormat" : "Date Format",
"Message_DateFormat_Description" : "See also: <a href=\"http://momentjs.com/docs/#/displaying/format/\" target=\"momemt\">Moment.js</a>",
"Message_deleting_not_allowed" : "Message deleting not allowed",
"Message_editing_blocked" : "This message cannot be edited anymore",
"Message_editing_not_allowed" : "Message editing not allowed",
Expand All @@ -564,6 +566,8 @@
"Message_ShowDeletedStatus" : "Show Deleted Status",
"Message_ShowEditedStatus" : "Show Edited Status",
"Message_ShowFormattingTips" : "Show Formatting Tips",
"Message_TimeFormat" : "Time Format",
"Message_TimeFormat_Description" : "See also: <a href=\"http://momentjs.com/docs/#/displaying/format/\" target=\"momemt\">Moment.js</a>",
"Message_too_long" : "Message too long",
"Messages" : "Messages",
"Messages_that_are_sent_to_the_Incoming_WebHook_will_be_posted_here" : "Messages that are sent to the Incoming WebHook will be posted here.",
Expand Down Expand Up @@ -1074,4 +1078,4 @@
"Your_Open_Source_solution" : "Your own Open Source chat solution",
"Your_password_is_wrong" : "Your password is wrong!",
"Your_push_was_sent_to_s_devices" : "Your push was sent to %s devices"
}
}
6 changes: 5 additions & 1 deletion packages/rocketchat-lib/i18n/ja.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@
"Message_AllowStarring" : "メッセージへのスターを許可する",
"Message_AudioRecorderEnabled" : "音声録音を有効にする",
"Message_AudioRecorderEnabledDescription" : "'audio/wav' が 'ファイルアップロード' 設定のメディア種類で許可されていなければなりません",
"Message_DateFormat" : "日付のフォーマット",
"Message_DateFormat_Description" : "参考: <a href=\"http://momentjs.com/docs/#/displaying/format/\" target=\"momemt\">Moment.js</a>",
"Message_deleting_not_allowed" : "メッセージを削除する権限がありません",
"Message_editing_blocked" : "このメッセージを編集できません",
"Message_editing_not_allowed" : "メッセージを編集する権限がありません",
Expand All @@ -528,6 +530,8 @@
"Message_ShowDeletedStatus" : "削除した状態を表示する",
"Message_ShowEditedStatus" : "編集した状態を表示する",
"Message_ShowFormattingTips" : "書式のヒントを表示する",
"Message_TimeFormat" : "時刻のフォーマット",
"Message_TimeFormat_Description" : "参考: <a href=\"http://momentjs.com/docs/#/displaying/format/\" target=\"momemt\">Moment.js</a>",
"Message_too_long" : "メッセージが長すぎです",
"Messages" : "メッセージ",
"Messages_that_are_sent_to_the_Incoming_WebHook_will_be_posted_here" : "Incoming WebHook へ送信されたメッセージは、こちらへ投稿されます。",
Expand Down Expand Up @@ -1023,4 +1027,4 @@
"Your_Open_Source_solution" : "独自のオープンソースチャットソリューション",
"Your_password_is_wrong" : "パスワードが間違っています!",
"Your_push_was_sent_to_s_devices" : "プッシュ通知が %s 台のデバイスへ送信されました"
}
}
2 changes: 2 additions & 0 deletions packages/rocketchat-lib/server/startup/settings.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ RocketChat.settings.addGroup 'Message', ->
@add 'Message_GroupingPeriod', 300, { type: 'int', public: true, i18nDescription: 'Message_GroupingPeriodDescription' }
@add 'API_Embed', true, { type: 'boolean', public: true }
@add 'API_EmbedDisabledFor', '', { type: 'string', public: true, i18nDescription: 'API_EmbedDisabledFor_Description' }
@add 'Message_TimeFormat', 'LT', { type: 'string', public: true, i18nDescription: 'Message_TimeFormat_Description' }
@add 'Message_DateFormat', 'LL', { type: 'string', public: true, i18nDescription: 'Message_DateFormat_Description' }


RocketChat.settings.addGroup 'Meta', ->
Expand Down
4 changes: 2 additions & 2 deletions packages/rocketchat-ui-message/message/message.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Template.message.helpers
chatops: ->
return 'chatops-message' if this.u?.username is RocketChat.settings.get('Chatops_Username')
time: ->
return moment(this.ts).format('LT')
return moment(this.ts).format(RocketChat.settings.get('Message_TimeFormat'))
date: ->
return moment(this.ts).format('LL')
return moment(this.ts).format(RocketChat.settings.get('Message_DateFormat'))
isTemp: ->
if @temp is true
return 'temp'
Expand Down