Sha256: 5e2ffadf067ffb720dc374db3821919c2b4fd596f1b5cda954137cb25eecd909

Contents?: true

Size: 984 Bytes

Versions: 1919

Compression:

Stored size: 984 Bytes

Contents

import React, { useEffect } from 'react'

import DatePicker from '../_date_picker'

import Button from '../../pb_button/_button'

const DatePickerFlatpickrMethods = () => {
  let fpInstance
  useEffect(() => {
    fpInstance = document.querySelector('#fp-methods')._flatpickr
  }, [])
  const clickHandlerClear = () => {
    fpInstance.clear()
  }
  const clickHandlerClose = () => {
    fpInstance.close()
  }
  const clickHandlerToday = () => {
    fpInstance.setDate(new Date(), true)
  }

  return (
    <div>
      <Button
          marginRight="sm"
          onClick={clickHandlerClose}
          text="Close"
      />
      <Button
          marginRight="sm"
          onClick={clickHandlerClear}
          text="Clear"
      />
      <Button
          onClick={clickHandlerToday}
          text="Today"
      />
      <DatePicker
          hideLabel
          marginTop="sm"
          pickerId="fp-methods"
      />
    </div>
  )
}

export default DatePickerFlatpickrMethods

Version data entries

1,919 entries across 1,919 versions & 2 rubygems

Version Path
playbook_ui-10.23.0.pre.alpha2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.23.0.pre.cachetest app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.23.0.pre.alpha1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.22.1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.22.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.21.1.pre.alpha1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.21.0.pre.alpha.lightbox.2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.21.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.21.0.pre.alpha.lightbox app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.21.0.pre.alpha.rg1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.21.0.pre.alpha.jg1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.21.0.pre.alpha.na1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.21.0.pre.alpha.jd1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.20.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.19.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.19.0.pre.lightbox app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.18.2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.19.0.pre.popover.alpha1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.18.1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-10.18.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx