Sha256: 489cd21a8081709b3f7955560d5175ce34e1c9c1e1b04020c72db06c474af1b4

Contents?: true

Size: 940 Bytes

Versions: 97

Compression:

Stored size: 940 Bytes

Contents

import React, { useEffect } from 'react'
import { Button, DatePicker } from '../../'

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

97 entries across 97 versions & 1 rubygems

Version Path
playbook_ui-9.3.0.alpha.inline2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.3.0.alpha.inline1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.3.0.pre.alpha.password.strength.1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.3.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.2.2.pre.alpha.margin app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.2.2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.2.1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.2.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.1.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.0.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-8.3.0.alpha.select.pre.margin app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-8.3.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-8.2.1.pre.alpha5 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-8.2.1.pre.alpha4 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-8.2.1.alpha.iconacc app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-8.2.1.pre.alpha3 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-8.2.1.pre.alpha2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-8.3.0.deps2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-8.3.0.pre.alpha1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-8.2.1.pre.alpha1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx