The initial callback of the control opens
The control is triggered when it is opened, and the callback returns a parameter: the initial date and time object
({ elem: '#test' ,ready: function(date){ (date); //Get the initial date and time object: {year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0} } });
Callback after the date and time have been switched
It will be triggered when the year, month, day and time are switched. The callback returns three parameters, representing: the generated value, the date-time object, and the end date-time object.
({ elem: '#test' ,change: function(value, date, endDate){ (value); //Get the value generated by the date, such as: 2017-08-18 (date); //Get date and time object: {year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0} (endDate); //The date and time object that needs to end will be returned only if the range selection is enabled (range: true). The same as above for the object members. } });
Callback after control selection
Clicking on date, clear, now, and confirm will all trigger. The callback returns three parameters, representing: the generated value, the date-time object, and the end date-time object.
({ elem: '#test' ,done: function(value, date, endDate){ (value); //Get the value generated by the date, such as: 2017-08-18 (date); //Get date and time object: {year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0} (endDate); //The date and time object that needs to end will be returned only if the range selection is enabled (range: true). The same as above for the object members. } });
This is the end of this article about the callback method of layui laydate selection time. For more related layui laydate callback content, please search for my previous article or continue browsing the related articles below. I hope everyone will support me in the future!