mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 11:57:16 +08:00
Merge pull request #6569 from aignatov-bio/ai-sci-9630-replace-datepicker-canvas
Replace datetime picker in canvas [SCI-9630]
This commit is contained in:
commit
71cb370db1
3 changed files with 13 additions and 5 deletions
|
@ -763,6 +763,8 @@ function bindEditDueDateAjax() {
|
|||
editDueDateModalBody.html(data.html);
|
||||
editDueDateModalTitle.text(data.title);
|
||||
|
||||
window.initDateTimePickerComponent('#date-time-picker');
|
||||
|
||||
// Add listener to form inside modal
|
||||
editDueDateModalBody.find("form")
|
||||
.on("ajax:success", function(ev2, data2, status2) {
|
||||
|
|
|
@ -50,6 +50,10 @@
|
|||
},
|
||||
watch: {
|
||||
datetime: function () {
|
||||
if ( this.datetime == null) {
|
||||
this.$emit('cleared');
|
||||
}
|
||||
|
||||
if (this.defaultValue != this.datetime) {
|
||||
let newDate = this.datetime;
|
||||
if (this.mode == 'time') {
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<%= form_with model: @my_module, url: my_module_path(@my_module, format: :json), data: { remote: :true }, builder: SciFormHelper::SciFormBuilder do |f| %>
|
||||
<%= f.datetime_picker :due_date,
|
||||
value: @my_module.due_date,
|
||||
label: t('my_modules.due_date.label'),
|
||||
clear: true,
|
||||
time: true %>
|
||||
<label class="sci-label">
|
||||
<%= t('my_modules.due_date.label') %>
|
||||
</label>
|
||||
<div id="date-time-picker" class="vue-date-time-picker">
|
||||
<input ref="input" type="hidden" v-model="date" name="my_module[due_date]" data-default="<%= @my_module.due_date %>" />
|
||||
<date-time-picker class="w-64" @cleared="clearDate" ref="vueDateTime" @change="updateDate" mode="date"></date-time-picker>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
Loading…
Add table
Reference in a new issue