@pageboard/datetime-entry

4.2.2 • Public • Published

DateTimeEntry

Enter formatted date and time without pickers.

This is the datetime-entry plugin from datetime without jquery.

Options

const defaults = {
 datetime: NaN,
 locale:   navigator.language,
 format:   {
  hour12:  false,
  hour:    '2-digit',
  minute:  '2-digit',
  second:  '2-digit',
  weekday: 'long',
  year:    'numeric',
  month:   'long',
  day:     'numeric',
  timeZone: 'Europe/Paris'
 },
 useUTC:   true,
 minDate:  NaN,
 maxDate:  NaN,
 minTime:  NaN,
 maxTime:  NaN,
 step: NaN, // in seconds
 onChange: t => {}
};

If this browser does not support this, is falls back to UTC (if useUTC is true) or none, which is the system timezone.

Usage

let inst = new window.DateTimeEntry(domElement, options);

What is inside

Instead of create huge data file with day names, month names, etc. I use Intl inside. So all languages supported by Intl, should be ready to use without any twitches.

What's next

  • Add ERA support
  • Increase test coverage
  • Optimize code

Package Sidebar

Install

npm i @pageboard/datetime-entry

Weekly Downloads

0

Version

4.2.2

License

MIT

Unpacked Size

19.6 kB

Total Files

5

Last publish

Collaborators

  • kapouer