-
Notifications
You must be signed in to change notification settings - Fork 135
Add datetime picker #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add datetime picker #169
Conversation
|
The sliders in Trent's timepicker seem awkward to use from a quick pass. Do you like them? Would users be more used to something like this? |
|
Yea, that does look a little bit cleaner, the only issue would be running all this as two separate inputs (one for date/one for time) might get a bit wonky. An alternative that might make things a bit cleaner is to just run the datetimepicker with 'select' by default and add a 'stepMinute' of 15 or 30 to the minutes dropdown. |
|
Scott's suggestion is my favorite format for time/number choosers. Mainly because "generic" dropdowns are supported on all devices. Even if it requires two inputs I'd prefer that. I also have a client who likes choosing to-the-minute publishing settings so the minute numbers don't look like they're scheduling things. But if you do want one input it may be worth considering consider a Bootstrap-like toggle option. I think these are easier than sliders on small screens, plus they don't have the tradeoff of big, 15-min increments vs. a too-long list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in the PR?
|
Thanks @cojennin. Can you rebase against master so I can merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this a private function, and add a @since 0.8 to the doc?
…the time by default, which I think should offer graceful backwards compatability. Determine if date or datetime should be displayed. Added a .date-pick and .date-time-pick class to differentiate between the classic datepicker and the datetimepicker. This is important because the budget uses a datepicker to determine the dates to display and having the ability to choose time could be confusing. Consolidated styling. Minor syntax and style fixes. Make function name more descriptive by changing from show_time to show_date_or_datetime. Select lists seem to be the preferred method for a datetime picker (plus they appear to be more platfrom/mobile friendly). I wanted to push this commit so the select is enabled by default. In the meantime, it would probably be worthwhile to look into incoporating some of the tools @sbressler and @mbijon mentioned as component types of the datetime picker. That way everything stays in one place and it looks sleek and stylish. Fixing issues with css and ef_date.js. Added a .date-pick and .date-time-pick class to differentiate between the classic datepicker and the datetimepicker. This is important because the budget uses a datepicker to determine the dates to display and having the ability to choose time could be confusing. Consolidated styling. Select lists seem to be the preferred method for a datetime picker (plus they appear to be more platfrom/mobile friendly). I wanted to push this commit so the select is enabled by default. In the meantime, it would probably be worthwhile to look into incoporating some of the tools @sbressler and @mbijon mentioned as component types of the datetime picker. That way everything stays in one place and it looks sleek and stylish. Rebased, added @SInCE 0.8 to show_date_or_datetime and made function private. Fixing rebase issues. Removed mistakenly committed code.
Add timepicker to editorial metadata date field
This request should fix #157. It replaces the normal JQuery Datepicker with a timepicker courtesy of Trent Richardson, provided under an MIT license.
To satisfy backwards compatibility concerns, by default or if the time selected is 00:00, the timepicker addon will not output a time to a "date" type metadata textbox. It will only output the time once a user has selected a time. Also, a datepicker is still utilized for the budget, so .date-time-pick and .date-pick classes have been created to differentiate between the two.
There are a few areas in the editorial metadata module where a date is displayed using the default 'date_format.' (In the calendar, budget and posts table screen when the metadata is viewable). For stylistic purposes I left those as is, but they can be altered if it makes more sense to display the time in those areas as well.