:: libs :: js-as-form :: as-form-pikaday

Library index

Plugin: “as-form-pikaday”

This AS.form plugin is a wrap to “Pikaday” by David Bushell.

Pikaday is Copyright © 2014 David Bushell | BSD & MIT license | github.com/Pikaday/Pikaday

Developed and maintained by balestra

Licensed under Creative Commons Attribution 4.0 License for free personal/professional/commercial use, with attribution.

Includes Pikaday.

Version 1.2, released on 2020-11-06

Provides

Fields of type:

The double class name is intentional: other plugins, loaded before or after this one, could re-define field type date.

Load plugin

Plugin URI: https://cdn.altersoftware.org/js-as-form/plugin/as-form-pikaday.js

Plugin name: pikaday

pikaday

asForm.addField( fieldname, 'pikaday', {options…} )

In alternative: asForm.addField(fieldname,'date', {options…} )

Generates a pure date picker (no time picker) field.

Common option keys can be used, in addition:

Date format

The format string contains:

E.g:

Date can be input with keyboard, in this case the input string is parsed regardless of the actual delimiter.

When decoding user input or field value:

E.g.:

Default values

Date format default

When plugin is loaded it defines AS.form default value dateStringFormat as D.M.YYYY, if not defined yet.

This will be the default date string format.

The command AS.form.setDefault('dateStringFormat','YYYY-MM-DD') can change it into YYYY-MM-DD from that moment on.

Week first day default

When plugin is loaded it defines AS.form default value weekFirstDay as 1 (Monday), if not defined yet.

This will be the default week first day.

The command AS.form.setDefault('weekFirstDay',0) can change it into Sunday from that moment on.

Version history