lanjingling0510 / react-mobile-datepicker

🙊 👻 look a demo, Please imitate mobile environment.
https://codepen.io/lanjingling0510/pen/LRpOYp?editors=1010
MIT License
301 stars 145 forks source link

Allow for Caption/Headers #31

Closed dejanvasic85 closed 5 years ago

dejanvasic85 commented 5 years ago

As a user, I want to know what I am actually selecting. Would be good to have a bar at the top indicating whether it's a day, hour or year.

See example: image

As opposed to: image

lanjingling0510 commented 5 years ago

@dejanvasic85 Thank you for your feedback.Do you have any good interface design Suggestions for it?

dejanvasic85 commented 5 years ago

Yes my first screenshot. Just use the header row instead of one of the row values.

lanjingling0510 commented 5 years ago

@dejanvasic85 I have added this feature in react-mobile-datepicker@4.0.0

It's used like this:

const dateConfig = {
    'hour': {
        format: 'hh',
        caption: 'Hour',
        step: 1,
    },
    'minute': {
        format: 'mm',
        caption: 'Min',
        step: 1,
    },
    'second': {
        format: 'hh',
        caption: 'Sec',
        step: 1,
    },
}

<DatePicker
    showCaption={true}
    dateConfig={dateConfig}
/>