* Add dateTimeFormat

This commit is contained in:
Bryan Ashby 2015-09-01 22:42:54 -06:00
parent e0f267c9a5
commit 8b3b36fd83
3 changed files with 15 additions and 2 deletions

View File

@ -88,6 +88,9 @@ function getDefaultConfig() {
},
timeFormat : {
short : 'h:mm a',
},
dateTimeFormat : {
short : 'MM/DD/YYYY h:mm a',
}
},

View File

@ -438,8 +438,7 @@ function FullScreenEditorModule(options) {
toView.setText(self.message.toUserName);
subjView.setText(self.message.subject);
// :TODO: set full date/time -- need a defaults dateTimeFormat
tsView.setText(moment(self.message.modTimestamp).format(self.client.currentTheme.helpers.getDateFormat()));
tsView.setText(moment(self.message.modTimestamp).format(self.client.currentTheme.helpers.getDateTimeFormat()));
};

View File

@ -77,6 +77,17 @@ function loadTheme(themeID, cb) {
if(_.has(theme, 'customization.defaults.timeFormat')) {
return theme.customization.defaults.timeFormat[style] || format;
}
return format;
},
getDateTimeFormat : function(style) {
style = style || 'short';
var format = Config.defaults.dateTimeFormat[style] || 'MM/DD/YYYY h:mm a';
if(_.has(theme, 'customization.defaults.dateTimeFormat')) {
return theme.customization.defaults.dateTimeFormat[style] || format;
}
return format;
}
};