Skip to content

Commit

Permalink
Add date/time format settings (#2852)
Browse files Browse the repository at this point in the history
  • Loading branch information
Maki Nishifuji authored and engelgabriel committed Apr 12, 2016
1 parent c015556 commit 08a6760
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
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

0 comments on commit 08a6760

Please sign in to comment.