custom fields: Improve date picker popover for date type fields.

This commit is contained in:
Yashashvi Dave 2018-05-16 22:52:43 +05:30 committed by Tim Abbott
parent b5cf73ae0c
commit a68ff22aed
2 changed files with 8 additions and 0 deletions

View File

@ -70,6 +70,7 @@ exports.add_custom_profile_fields_to_settings = function () {
var is_long_text = field_type === "Long text";
var is_choice_field = field_type === "Choice";
var is_user_field = field_type === "User";
var is_date_field = field_type === "Date";
var field_choices = [];
if (field_type === "Long text" || field_type === "Short text") {
@ -107,6 +108,7 @@ exports.add_custom_profile_fields_to_settings = function () {
is_long_text_field: is_long_text,
is_choice_field: is_choice_field,
is_user_field: is_user_field,
is_date_field: is_date_field,
field_choices: field_choices,
});
$("#account-settings .custom-profile-fields-form").append(html);
@ -137,6 +139,9 @@ exports.add_custom_profile_fields_to_settings = function () {
});
}
});
$(".custom_user_field .datepicker").flatpickr({
altInput: true,
altFormat: "F j, Y"});
};
exports.set_up = function () {

View File

@ -15,6 +15,9 @@
<div class="pill-container">
<div class="input" contenteditable="true"></div>
</div>
{{else if is_date_field }}
<input class="custom_user_field_value datepicker" data-field-id="{{ field.id }}" type="text"
value="{{ field_value }}" />
{{else}}
<input class="custom_user_field_value" type="{{ field_type }}" value="{{ field_value }}" maxlength="50" />
{{/if}}