mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 01:44:34 +08:00
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:
parent
7c84ecb108
commit
77de460182
5 changed files with 7 additions and 6 deletions
|
@ -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);
|
||||
|
|
|
@ -83,6 +83,8 @@ var DasboardCalendarWidget = (function() {
|
|||
};
|
||||
}());
|
||||
|
||||
var formatJS;
|
||||
$(document).on('turbolinks:load', function() {
|
||||
DasboardCalendarWidget.init();
|
||||
formatJS = $('body').data('datetime-picker-format');
|
||||
});
|
||||
|
|
|
@ -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
|
||||
});
|
||||
|
|
|
@ -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 %>
|
||||
|
|
|
@ -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 %>
|
||||
>
|
||||
|
||||
|
|
Loading…
Reference in a new issue