InputfieldDatetime class

Inputfield that accepts date and optionally time

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the InputfieldDatetime class also inherits all the methods and properties of: Inputfield, WireData and Wire.

Show class?             Show args?        

Common

NameReturnSummary 
InputfieldDatetime::changeMonth bool int Show a select dropdown to allow changing month? (default=true) 
InputfieldDatetime::changeYear bool int Show a select dropdown to allow changing year? (default=true) 
InputfieldDatetime::dateInputFormat string Date input format to use, see WireDateTime::$dateFormats (default='Y-m-d') 
InputfieldDatetime::dateMax string Refers to the max attribute on date inputs, ISO-8601 (YYYY-MM-DD) 
InputfieldDatetime::dateMin string Refers to the min attribute on date inputs, ISO-8601 (YYYY-MM-DD) 
InputfieldDatetime::dateSelectFormat string Format to use for date select, i.e. 'mdy' for 'Sep 1 2024' or 'Mdy' for 'September 1 2024' 
InputfieldDatetime::dateStep int Refers to the step attribute on date inputs 
InputfieldDatetime::datepicker int jQuery UI datepicker type (see `datepicker*` constants) 
InputfieldDatetime::datepickerOptions()
arrayGet or set jQuery UI datepicker (and timepicker) options 
InputfieldDatetime::defaultToday int bool When no value is present, default to today’s date/time? 
InputfieldDatetime::getConfigInputfields()
InputfieldWrapperDate/time Inputfield configuration, per field
InputfieldDatetime::getInputType()
InputfieldDatetimeTypeGet current date/time input type instance 
InputfieldDatetime::getInputTypes()
InputfieldDatetimeTypeGet all date/time input types 
InputfieldDatetime::htmlType string When "html" is selection for $inputType, this should be one of: "date", "time" or "datetime". 
InputfieldDatetime::inputType string Input type to use, one of: "text", "select" or "html" (when html type is used, also specify $htmlType). 
InputfieldDatetime::numberOfMonths int Number of month calendars to show together side-by-side (default=1) 
InputfieldDatetime::placeholder string Placeholder attribute text 
InputfieldDatetime::processInput(WireInputData $input)
Inputfield InputfieldDatetimeProcess input
InputfieldDatetime::render()
stringRender the date/time inputfield
InputfieldDatetime::renderReady()
boolCalled before the render method, from a hook in the Inputfield class 
InputfieldDatetime::renderValue()
stringRender value for presentation, non-input
InputfieldDatetime::requiredAttr bool int When combined with "required" option, this also makes it use the HTML5 "required" attribute (default=false). 
InputfieldDatetime::set(string $key, mixed $value)
Inputfield WireDataSet property 
InputfieldDatetime::setAttribute(string $key, mixed $value)
Inputfield InputfieldDatetimeCapture setting of the 'value' attribute and convert string dates to unix timestamp 
InputfieldDatetime::showAnim string Animation type (default='fade') 
InputfieldDatetime::showButtonPanel bool int Show "Today" and "Done" buttons under the calendar? (default=false) 
InputfieldDatetime::showMonthAfterYear bool int Show the month after the year? (default=false) 
InputfieldDatetime::showOtherMonths bool int Show dates in other months (non-selectable) at the start or end of the current month? (default=false) 
InputfieldDatetime::subDay int Substitute day when month+year or time only selectinos are made (default=8) 
InputfieldDatetime::subHour int Substitute hour when date-only selections are made (default=0) 
InputfieldDatetime::subMinute int Substitute minute when date-only selection are made (default=0) 
InputfieldDatetime::subMonth int Substitute month when time-only selections are made (default=4) 
InputfieldDatetime::subYear int Substitute year when month+day or time only selections are made (default=2010) 
InputfieldDatetime::timeInputFormat string Time input format to use, see WireDateTime::$timeFormats (default='') 
InputfieldDatetime::timeInputSelect int jQuery UI timeSelect type (requires datepicker)—specify 1 to use a `<select>` for time input, or 0 to use a slider (default=0) 
InputfieldDatetime::timeMax string Refers to the max attribute on time inputs (HH:MM) 
InputfieldDatetime::timeMin string Refers to the min attribute on time inputs (HH:MM) 
InputfieldDatetime::timeSelectFormat string Format to use for time select 
InputfieldDatetime::timeStep int Refers to the step attribute on time inputs 
InputfieldDatetime::value int This Inputfield keeps the value in UNIX timestamp format (int). 
InputfieldDatetime::yearFrom int First selectable year (default=current year - 100) 
InputfieldDatetime::yearLock bool int Disallow selection of years outside the yearFrom/yearTo range? (default=false) 
InputfieldDatetime::yearRange string Selectable year range in the format `-30:+20` where -30 is number of years before now and +20 is number of years after now. 
InputfieldDatetime::yearTo int Last selectable year (default=current year + 20) 

Additional methods and properties

In addition to the methods and properties above, InputfieldDatetime also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.244

Latest news

  • ProcessWire Weekly #558
    In the 558th issue of ProcessWire Weekly we'll check out the blog post that introduces ProcessWire 3.0.244, share some recent ProcessWire highlights, and more. Read on!
    Weekly.pw / 18 January 2025
  • ProcessWire 3.0.244 new main/master version
    ProcessWire 3.0.244 is our newest main/master/stable version. It's been more than a year in the making and is packed with tons of new features, issue fixes, optimizations and more. This post covers all the details.
    Blog / 18 January 2025
  • Subscribe to weekly ProcessWire news

“We were really happy to build our new portfolio website on ProcessWire! We wanted something that gave us plenty of control on the back-end, without any bloat on the front end - just a nice, easy to access API for all our content that left us free to design and build however we liked.” —Castus, web design agency in Sheffield, UK