@sanity/rich-date-input

2.0.9 • Public • Published

@sanity/rich-date-input

A richer date/time type and input component for Sanity form builder

Usage

  • sanity install @sanity/rich-date-input
  • In your schema:
    import richDate from 'part:@sanity/form-builder/input/rich-date/schema'
    
    // ...
    export default createSchema({
      name: 'mySchema',
      types: [
        //...
        richDate
      ]
    })

Typical data output:

{
  _type: 'richDate',
  local: '2017-02-21T10:15:00+01:00',
  utc: '2017-02-12T09:15:00Z',
  timezone: 'Europe/Oslo',
  offset: 60
}

Options

This component accepts the following options via the Sanity schema:

options.dateFormat || 'YYYY-MM-DD'
options.timeFormat || 'HH:mm'
options.calendarTodayLabel || 'Today'
options.timeStep || 15
options.inputUtc || false
options.inputDate || true
options.inputTime || true
options.placeholderDate || moment().format(options.dateFormat)
options.placeholderTime || moment().format(options.timeFormat)

Install

npm i @sanity/rich-date-input

DownloadsWeekly Downloads

1,653

Version

2.0.9

License

MIT

Unpacked Size

15.2 kB

Total Files

11

Last publish

Collaborators

  • simen.svale
  • benjaminakar
  • svirs
  • josh_sanity_io
  • joneidejohnsen
  • nina.andal
  • rankers
  • snorreeb
  • mattcraig
  • vincentquigley
  • stipsan
  • michael-sanity
  • rubioz
  • tonina
  • ritasdias
  • simeonsanity
  • kmelve
  • bjoerge
  • rexxars
  • skogsmaskin
  • robinpyon
  • mariuslundgard
  • sanity-io
  • evenw
  • radhe_sanity
  • rbotten
  • vicbergquist
  • judofyr
  • obliadp
  • dcilke
  • fredcarlsen
  • hermanw
  • mikolajsanity
  • sgulseth
  • atombender