mirror of https://github.com/zulip/zulip.git
user profile: Improve format of date type of custom fields in popover.
In user profile popover, date type of custom fields values are not showing in correct format as "date_joined" value. Fix this using moment.js to render date type of fields in correct format.
This commit is contained in:
parent
a68ff22aed
commit
40029a0753
|
@ -179,7 +179,12 @@ function show_user_profile(element, user) {
|
|||
var profile_data = {};
|
||||
|
||||
page_params.custom_profile_fields.forEach(function (field) {
|
||||
profile_data[field.name] = people.get_custom_profile_data(user.user_id, field.id);
|
||||
var field_value = people.get_custom_profile_data(user.user_id, field.id);
|
||||
if (settings_profile_fields.field_type_id_to_string(field.type) === "Date") {
|
||||
profile_data[field.name] = moment(field_value).format("MMMM DD YYYY");
|
||||
} else {
|
||||
profile_data[field.name] = field_value;
|
||||
}
|
||||
});
|
||||
|
||||
var time_preferance = people.get_user_time_preferences(user.user_id);
|
||||
|
|
Loading…
Reference in New Issue