📅  最后修改于: 2023-12-03 15:32:16.467000             🧑  作者: Mango
The setDate()
method of the jQWidgets jqxDateTimeInput widget is used to set the selected date in the calendar popup. This method takes a single parameter of type Date
and sets it as the selected date in the calendar popup.
The syntax of the setDate()
method is as follows:
$("#jqxDateTimeInput").jqxDateTimeInput("setDate", date);
Where:
$("#jqxDateTimeInput")
is the selector for the jQWidgets jqxDateTimeInput widget;"setDate"
is the method name;date
is a Date
object representing the selected date to set in the calendar popup.The following example demonstrates how to use the setDate()
method to set the selected date in the calendar popup:
// Set the selected date in the calendar popup to January 1, 2022
let date = new Date(2022, 0, 1);
$("#jqxDateTimeInput").jqxDateTimeInput("setDate", date);
The setDate()
method takes a single parameter, which is a Date
object representing the selected date to set in the calendar popup.
The setDate()
method does not return anything.
date
parameter is not a Date
object, a TypeError will be thrown.date
parameter is invalid (e.g. NaN
, an out-of-range value), the selected date in the calendar popup will not be changed.The setDate()
method of the jQWidgets jqxDateTimeInput widget is used to set the selected date in the calendar popup. This method takes a single parameter of type Date
and sets it as the selected date in the calendar popup. It does not return anything and will throw a TypeError if the parameter is not a Date
object.