I have encountered an issue with my Vue date picker.
Although I am able to view and select the date, when I attempt to retrieve the date using the getDate
method, it always returns as null
.
If anyone could offer assistance with resolving this problem, I would greatly appreciate it. Here is the relevant code:
var overviewVue;
function initOverviewVue(model) {
overviewVue = new Vue({
el: '#overviewVue',
data: {
OverviewModel: model,
repeatSchedule: [],
startDate: ''
},
methods: {
setOverviewDatePickers: function (target) {
var $target = $(target);
$target.daterangepicker({
autoUpdateInput: false,
locale: {
format: 'DD/M hh:mm',
cancelLabel: 'Clear'
},
timePicker24Hour: true,
timePicker: true,
singleDatePicker: true,
showDropdowns: true
}, function (chosen_date) {
this.startDate = chosen_date.format('DD/MM/YYYY HH:mm');
$target.val(this.startDate);
});
},
getDate: function () {
return this.startDate;
}
}
});
}