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.19.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.19.0.pre.alphafonts app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.18.0.flow.bin.alpha app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.18.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.17.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.17.0.pre.decouple.website2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.16.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.15.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.15.0.pre.decouple.website1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.14.1.alpha.radio.alignment app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.14.1.alpha.highcharts9 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.14.1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.13.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.12.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.12.0.pre.text.addon app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.11.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.10.0 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.10.0.pre.date.time.stacked.1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.10.0.pre.alpha2 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx
playbook_ui-9.10.0.pre.alpha1 app/pb_kits/playbook/pb_date_picker/docs/_date_picker_flatpickr_methods.jsx