Skip to content

Conversation

@cojennin
Copy link
Contributor

@cojennin cojennin commented Mar 7, 2013

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.

@sbressler
Copy link
Contributor

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?

@cojennin
Copy link
Contributor Author

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.

@mbijon
Copy link

mbijon commented Mar 15, 2013

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:

Copy link
Contributor

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?

@danielbachhuber
Copy link
Contributor

Thanks @cojennin. Can you rebase against master so I can merge?

Copy link
Contributor

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.
danielbachhuber added a commit that referenced this pull request Mar 17, 2013
Add timepicker to editorial metadata date field
@danielbachhuber danielbachhuber merged commit 82cc765 into Automattic:master Mar 17, 2013
@cojennin cojennin deleted the add-datetime-picker branch December 23, 2013 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add time support for editorial metadata date field

4 participants