Controls to select a date and optional time.
This DateTimePicker is a wrapper for the jQuery UI DatePicker control with some extra functionality. All jQuery javascript apis work with this control.
HTML id attribute of the control
HTML name attribute of the control
The class to use on the date section of the control
The class to use on the time section of the control
The class to use on the input group of the date control. For special formatting between the date and the calendar icon.
Show the date control
Show the time controls
Make the control read only.
The DateTime value to display
The minimum allowed DateTime value
The maximum allowed DateTime value
When the value is null use "00" for the minutes instead of leaving it empty.
The minimum allowed Hours value
The maximum allowed Hours value
Show as either 24 hour or AM/PM.
HourTypes.TwentyFourHour - 24 hour mode.
HourTypes.AmPm - AM / PM mode.
Allow null values. Places an empty option on the hour and minute selectors.
The number of intervals between minutes. By default it is 1 which is 1 minute. Set to 15 to only show 15 minute increments etc.
Set as a required field.
Adjusts the minimum year displayed on the calendar control and drop down box. This does not prevent a date being typed in for an earlier year.
Adjusts the maximum year displayed on the calendar control and drop down box. This does not prevent a date being typed in for a later year.
Puts the text as a placeholder in the date field.
The minimum allowed DateTime value
The maximum allowed DateTime value
Changes the date in the control
Changes the hour in the control
Changes the minute in the control
Format a javascript month as "d MMM yyyy".
Triggered after a date or time has changed. $('#MyDate').on('changed', function(d) { });
@Html.DateTimePickerFor(model => model.MyDate, htmlAttributes: new { @class = "form-control" })
CreateDateUtc
DateTime.NowUtc@m.CreateDateUtc.FormatClientFromUtcDateTime(tzId)ClockOnTime
@m.ClockOnTime.FormatDateTime(tzId)Start of Year or Start of Financial Year
var dt = DateTime.UtcNow.UtcToOffsetDate(timezoneId)var dt = DateTimeOffset.UtcNow.FormatDate(timezoneId)var dt = DateTime.UtcNow.UtcToClientOffset(timezoneId).FinancialYearStart().ClientLocalDateToOffset(timezoneId)DateTime.UtcNow.Date.UtcToOffsetDate(timezoneId)