I'm using the Jquery date time picker link here
In the four methods below I am initializing the DT pickers but they are all pretty similar except for the ID in the onChangeDateTime
.
Is there a way I can reduce the duplicate code?
$('.jqDatetimeDateOne').datetimepicker({
defaultTime: '07:00',
lang: 'en',
className: 'setTimeClicker',
step: 30,
onChangeDateTime: function (current_time, $input) {
// alert(ct.dateFormat('d/m/Y'))
$('#emailGenDateOne').removeClass('empty').val(current_time.dateFormat('Y-m-d H:i'));
},
inline: true
});
$('.jqDatetimeDateTwo').datetimepicker({
defaultTime: '07:00',
lang: 'en',
className: 'setTimeClicker',
step: 30,
onChangeDateTime: function (current_time, $input) {
// alert(ct.dateFormat('d/m/Y'))
$('#emailGenDateTwo').removeClass('empty').val(current_time.dateFormat('Y-m-d H:i'));
},
inline: true
});
$('.jqDatetimeSearchDateOne').datetimepicker({
defaultTime: '07:00',
lang: 'en',
className: 'setTimeClicker',
step: 30,
onChangeDateTime: function (current_time, $input) {
// alert(ct.dateFormat('d/m/Y'))
$('#searchGenDateOne').removeClass('empty').val(current_time.dateFormat('Y-m-d H:i'));
},
inline: true
});
$('.jqDatetimeSearchDateTwo').datetimepicker({
defaultTime: '07:00',
lang: 'en',
className: 'setTimeClicker',
step: 30,
onChangeDateTime: function (current_time, $input) {
// alert(ct.dateFormat('d/m/Y'))
$('#searchGenDateTwo').removeClass('empty').val(current_time.dateFormat('Y-m-d H:i'));
},
inline: true
});