1.4.4 • Published 2 years ago

material-duration-picker v1.4.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Material-Duration-Picker

Simple duration picker inspired by Material-UI Pickers

image

To install

npm install --save material-duration-picker

or

yarn add material-duration-picker

Dependencies:

To use:

This example uses date-fns to format the duration

import {DurationPicker} from "./durationPicker";
import {formatDuration} from 'date-fns'

const Comp = () => {
  const [value, setValue] = useState(0)
  return (
    <div>
      <DurationPicker
        label='Duration'
        value={value}
        onValueChange={(v) => setValue(v)}
        formatDuration={formatDuration}
      />
    </div>
  );
}

demo

Props

  • value: (REQUIRED) The duration value in seconds
  • onValueChange: (REQUIRED) On change callback
  • formatDuration: function to customize the way that the duration is formatted
  • views: Array of views to offer. MUST BE FROM BIGGEST TO SMALLEST ex: 'weeks', 'minutes', 'seconds'
  • disableEditDialog: If should not enable the edit dialog on click of the field
  • DurationDialogProps: Props passed to the dialog

Remaining props are passed to the TextField component

Localisation

https://github.com/tran-simon/material-duration-picker/issues/1#issuecomment-870100173

Sandbox example

1.4.5-muiv5

2 years ago

1.4.4-muiv5

2 years ago

1.4.4

2 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.0

3 years ago