Due date flyout on dashboard calendar [SCI-8600] (#5554)

* Change the scope of the DatePicker datetime format in global activities [SCI-8600]
This commit is contained in:
Soufiane 2023-06-09 09:24:32 +02:00 committed by GitHub
parent 7c84ecb108
commit 77de460182
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 6 deletions

View file

@ -43,9 +43,6 @@
// forms with clicking on links outside form in cases when other than
// GET method is used.
// eslint-disable-next-line no-unused-vars
var formatJS = $('body').data('datetime-picker-format-date-only');
function initFormSubmitLinks(el) {
el = el || $(document.body);

View file

@ -83,6 +83,8 @@ var DasboardCalendarWidget = (function() {
};
}());
var formatJS;
$(document).on('turbolinks:load', function() {
DasboardCalendarWidget.init();
formatJS = $('body').data('datetime-picker-format');
});

View file

@ -1,10 +1,11 @@
/* global I18n formatJS */
/* global I18n */
(function() {
$('.datetime-picker-container').each(function() {
const id = $(this).data('id');
if (id) {
const dt = $(`#calendar-${id}`);
const useCurrent = $(this).data('use-current');
const formatJS = $(this).data('datetime-picker-format');
dt.datetimepicker({
useCurrent, ignoreReadonly: true, locale: I18n.locale, format: formatJS
});

View file

@ -1,7 +1,8 @@
<div class="datetime-picker-container"
id="<%= id %>"
data-id="<%= id %>"
data-use-current="<%= use_current %>">
data-use-current="<%= use_current %>"
data-datetime-picker-format="<%= datetime_picker_format_date_only %>">
<% if label %>
<label class="control-label required" for="calendar-<%= id %>"><%= label %></label>
<% end %>

View file

@ -59,7 +59,7 @@
data-atwho-repositories-url="<%= atwho_menu_team_path(current_team) %>"
data-atwho-rep-items-url="<%= atwho_rep_items_team_path(current_team) %>"
data-atwho-menu-items="<%= atwho_menu_items_team_path(current_team) %>"
data-datetime-picker-format-date-only="<%= datetime_picker_format_date_only %>"
data-datetime-picker-format="<%= datetime_picker_format_date_only %>"
<% end %>
>