Date picker (input type='date' polyfill, Calendar interface) - nschonni/wet-boew GitHub Wiki

français

This feature dynamically generates a calendar interface for selecting a date in a form.

Table of Contents

Background

Project Lead: Stephane Berube (@berubs)

Purpose

The purpose of this feature is to provide an interface for selecting a date in a form.

Rationale

This feature can be used on any page where selecting a date in a form is required.

Implementation

  1. Add a text input field for each date that will be requested. Each text input field must have the "date" type applied to it.
  2. Optional: Change the value of max to the latest date that can be selected by the user
  3. Optional: Change the value of min to the earliest date that can be selected by the user

Code example

<div>
  <label for="startdate">Start Date (<abbr title="Four digits year">YYYY</abbr>-<abbr title="Two digits month">MM</abbr>-<abbr title="Two digits day">DD</abbr>):</label>
  <input type="date" id="startdate" name="startdate" min="2008-01-01" max="2009-01-01" />
</div>
<div>
  <label for="enddate">End Date (<abbr title="Four digits year">YYYY</abbr>-<abbr title="Two digits month">MM</abbr>-<abbr title="Two digits day">DD</abbr>):</label>
  <input type="date" id="enddate" name="enddate" min="2009-01-01" max="2010-01-01" />
</div>

Examples=

Development

The date picker is dependent upon native support for the HTML5 input type="date", the date picker polyfill and the calendar library.

The code for the date picker is located in several places within the source folder of WET:

Known Issues

There are no known issues at this point in time.

Future

Feel free to suggest feature/enhancements in the issue tracker.

Version History

Related Pages

References

⚠️ **GitHub.com Fallback** ⚠️