mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-10 17:39:38 +08:00
8ce321456e
* Add time filter [SCI-6217] * Add datetime filter for inventory [SCI-6220] * Refactor components structure Co-authored-by: Anton <anton@scinote.net>
32 lines
799 B
Vue
32 lines
799 B
Vue
<template>
|
|
<div class="datepicker">
|
|
<input @change="update" type="datetime" class="form-control calendar-input" :id="this.selectorId" placeholder="" />
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'DatePicker',
|
|
props: {
|
|
selectorId: { type: String, required: true },
|
|
useCurrent: { type: Boolean, default: true }
|
|
},
|
|
mounted() {
|
|
$("#" + this.selectorId).datetimepicker(
|
|
{
|
|
useCurrent: this.useCurrent,
|
|
ignoreReadonly: this.ignoreReadOnly,
|
|
locale: this.i18n.locale,
|
|
format: this.dateFormat
|
|
}
|
|
);
|
|
|
|
$("#" + this.selectorId).on('dp.change', (e) => this.update(e.date))
|
|
},
|
|
methods: {
|
|
update(value) {
|
|
this.$emit('change', value.toDate());
|
|
}
|
|
}
|
|
}
|
|
</script>
|