diff --git a/app/assets/javascripts/moderation.js.erb.coffee b/app/assets/javascripts/moderation.js.erb.coffee index 0eb4ec03..f42f8875 100644 --- a/app/assets/javascripts/moderation.js.erb.coffee +++ b/app/assets/javascripts/moderation.js.erb.coffee @@ -2,4 +2,4 @@ #= require tempusdominus-bootstrap-4 #= require_tree ./moderation -$('.datetimepicker-input').datetimepicker(); \ No newline at end of file +$('.datetimepicker-input').datetimepicker({}); \ No newline at end of file diff --git a/app/assets/javascripts/moderation/ban.coffee b/app/assets/javascripts/moderation/ban.coffee index fecd10cf..8530ff23 100644 --- a/app/assets/javascripts/moderation/ban.coffee +++ b/app/assets/javascripts/moderation/ban.coffee @@ -19,21 +19,6 @@ load = -> else $("#ban-controls-time").show() - untilInput = $ modalForm.elements["until"] - untilInput.datetimepicker - defaultDate: untilInput.val() - sideBySide: true - icons: - time: "fa fa-clock-o" - date: "fa fa-calendar" - up: "fa fa-chevron-up" - down: "fa fa-chevron-down" - previous: "fa fa-chevron-left" - next: "fa fa-chevron-right" - today: "fa fa-home" - clear: "fa fa-trash-o" - close: "fa fa-times" - modalForm.addEventListener "submit", (event) -> event.preventDefault(); diff --git a/app/views/modal/_ban.haml b/app/views/modal/_ban.haml index 0e1d5752..2eede521 100644 --- a/app/views/modal/_ban.haml +++ b/app/views/modal/_ban.haml @@ -14,7 +14,7 @@ #ban-controls{style: "#{"display: none" unless @user.banned?}"} = f.check_box :permaban, label: t('views.modal.bancontrol.permanent'), checked: @user.permanently_banned? #ban-controls-time{style: "#{"display: none" unless not @user.permanently_banned?}"} - = f.text_field :until, label: "", required: true, value: (@user.banned_until || DateTime.current).strftime("%m/%d/%Y %I:%M %p") + = f.text_field :until, label: "", required: true, value: (@user.banned_until || DateTime.current).strftime("%m/%d/%Y %I:%M %p"), class: "datetimepicker-input", data: { toggle: "datetimepicker", target: "#until" } = f.text_field :reason, placeholder: t('views.modal.bancontrol.reason'), value: @user.ban_reason .modal-footer %button.btn.btn-default{name: 'stop-time', type: :button, data: { dismiss: :modal }}= t 'views.actions.close'