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.9.0.alpha.inline1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.9.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.8.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.7.0.pre.alphawidth1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.7.0.pre.alpha.a11y.btn app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.7.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.6.1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.6.1.pre.deps1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.6.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.5.0.alpha.rs.downgrade app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.5.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.4.0.alpha.sisense app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.4.0.alpha.user.kit.bug app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.4.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.3.1.pre.alpha2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.4.0.pre.alpha2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.4.0.pre.alpha1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.3.1.pre.alpha1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.3.0.alpha.inline3 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.3.0.pre.alpha.password.strength.2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx