WordPress.org

Make WordPress Core

Opened 13 years ago

Closed 4 weeks ago

#7665 closed enhancement (wontfix)

Add jQuery UI's datepicker() where applicable

Reported by: Viper007Bond Owned by: chsxf
Milestone: Priority: lowest
Severity: normal Version: 2.7
Component: Editor Keywords: has-patch needs-testing
Focuses: ui Cc:

Description (last modified by aaroncampbell)

Obviously it'll need some skinning, but it's handy dandy:

http://jqueryui.com/demos/datepicker/

It'd be slick to have that for choosing dates (for example publish dates). We should still allow manual entry though.

Attachments (5)

patch-jquery-date-and-time-picker.diff (32.0 KB) - added by chsxf 10 years ago.
Unified diff of the modified files
patch-jquery-date-and-time-picker-new-files.tar.gz (36.4 KB) - added by chsxf 10 years ago.
New files (JavaScript and CSS files)
patch-jquery-date-and-time-picker2.diff (29.6 KB) - added by chsxf 10 years ago.
New unified diff of the modified files
patch-jquery-date-and-time-picker-new-files2.tag.gz (50.7 KB) - added by chsxf 10 years ago.
New package of the new files (JavaScript and CSS files)
patch-jquery-date-and-time-picker3.diff (29.6 KB) - added by chsxf 10 years ago.
Synced-with-lastest-trunk-revision unified diff of the modified files

Download all attachments as: .zip

Change History (56)

#1 @ryan
13 years ago

Datepicker linked to dropdowns might be nice. We'd need to massage its i18n to use our gettext.

#2 @caesarsgrunt
13 years ago

+1. I'd really like a datepicker.
But themed; the example one on jquery.com is uuuglyyy...

#3 @ShaneF
13 years ago

+1, as well.

#4 @ryan
13 years ago

  • Milestone changed from 2.7 to 2.8

#5 @ydekproductions
13 years ago

  • Version changed from 2.7 to 2.8

Hey guys, I know this is a bit early, but I have a pretty good understanding of this, and I'd like to tackle this if nobody else is. :)

Got any ideas on how the skin should look?

#6 @jacobsantos
13 years ago

  • Milestone changed from 2.8 to 2.9

No patch.

#7 @FFEMTcJ
13 years ago

  • Milestone changed from 2.9 to Future Release

#8 @Denis-de-Bernardy
13 years ago

  • Component changed from Administration to JavaScript
  • Milestone changed from Future Release to 2.9
  • Owner changed from anonymous to azaozz

#9 @Denis-de-Bernardy
12 years ago

  • Component changed from JavaScript to Editor
  • Owner azaozz deleted

#10 @Denis-de-Bernardy
12 years ago

  • Milestone changed from 2.9 to Future Release

punting this back pending patch

#11 @johnbillion
11 years ago

  • Cc johnbillion@… added

#12 @dahamsta
11 years ago

+1 for a proper date picker, scheduling is incredibly awkward at the moment.

Please merge with 11942: #11942

Version 1, edited 10 years ago by scribu (previous) (next) (diff)

#13 @scribu
11 years ago

  • Cc scribu added

#14 @goldenapples
10 years ago

  • Cc goldenapples added

#15 @aaroncampbell
10 years ago

  • Cc aaroncampbell added
  • Description modified (diff)
  • Version changed from 2.8 to 2.7

Just updating the link in the description

#16 @chsxf
10 years ago

  • Cc christophe@… added

#17 @chsxf
10 years ago

I'm working on a patch for this.
It should be available by the end of the week, maybe earlier.

#18 @chsxf
10 years ago

  • Owner set to chsxf
  • Status changed from new to assigned

@chsxf
10 years ago

Unified diff of the modified files

@chsxf
10 years ago

New files (JavaScript and CSS files)

#19 @chsxf
10 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

#20 follow-up: @scribu
10 years ago

It would be nice if you could find a way to avoid using date_parse_from_format().

Also, commonL10n.datePicker_month01 etc. is really ugly. Related: #11520

#21 in reply to: ↑ 20 @chsxf
10 years ago

Replying to scribu:

It would be nice if you could find a way to avoid using date_parse_from_format().

Also, commonL10n.datePicker_month01 etc. is really ugly. Related: #11520

I can search a way to avoid using date_parse_from_format() but what is the problem with this function ? Does the problem come from my placeholder implementation of the function ?

Concerning the second point, I may use the official translations provided by jQuery for the date picker but I still need to provide at least translations for the time picker and the firstDay setting for the date picker. Is this OK if I leave those ones inside commonL10n or not ?

@chsxf
10 years ago

New unified diff of the modified files

#22 @chsxf
10 years ago

New attachments include some modifications for the date picker translations by supporting official jQuery translations.

For the PHP side, I still use date_parse_from_format() as I don't find another way to handle dates correctly yet.

Note : replaced tar.gz attachment because a file was missing. Sorry for the typo in the file suffix but it is not possible for me to rename the attachment.

Last edited 10 years ago by chsxf (previous) (diff)

@chsxf
10 years ago

New package of the new files (JavaScript and CSS files)

#23 @scribu
10 years ago

Closed #18659 as dup.

#24 @sirzooro
10 years ago

  • Cc sirzooro added

#17952 / [18757] added jQuery datepicker to WP Core. Now is probably too late to get this ticket resolved in WP3.3, but it is a good candidate for WP3.4 Please make sure that patch is up to date.

@chsxf
10 years ago

Synced-with-lastest-trunk-revision unified diff of the modified files

#25 @chsxf
10 years ago

Latest attachment contains my patch synced against today's latest trunk (WP 3.3 development version - r18813)

#26 @ciantic
10 years ago

  • Cc ciantic@… added

Is this patch missing something, or why this is not commited to trunk?

Patch seems awesome and not committing or giving advice how to improve it (so it gets commited) is just rude for the patch-maker. Wasting ones time on upgrading patch against trunk again and again!

Everybody needs this patch (or at least me!)

#27 @scribu
10 years ago

Is this patch missing something, or why this is not commited to trunk?

http://wpdevel.wordpress.com/version-3-3-project-schedule/

Everybody needs this patch (or at least me!)

lol

#28 @WraithKenny
10 years ago

related #18909

I've noticed with the current version of jQuery, and the current version of jQuery UI that the datepicker's events have issues (create, onChangeMonthYear, onSelect don't fire, beforeShowDay gives errors, onClose and beforeShow did work) At least with my tests.

Also, datepicker doesn't support "Theme CSS Scope" (for multiple themes per page).

Last edited 10 years ago by WraithKenny (previous) (diff)

#29 follow-up: @WraithKenny
10 years ago

Please also consider an html5 input[type="date"] with feature detection to fail back onto jQuery UI. Opera is the only decent native datepicker though.

#30 follow-up: @iandunn
10 years ago

  • Cc ian_dunn@… added

+1 for this; I'd really like to be able to use datepicker() in plugins/themes. I don't see why the entire jQueryUI library wasn't added to core. Just because the WP core doesn't use it doesn't mean that plugins/themes won't, and it's counter-intuitive to have only parts of a library available. If you say that jQueryUI is bundled w/ WP then ALL of it should be bundled, not just certain parts.

I'm not suggesting that it be enqueued by default, of course, just that it should be available so that plugins/themes can enqueue it when needed.

#31 in reply to: ↑ 30 ; follow-ups: @scribu
10 years ago

Replying to iandunn:

I don't see why the entire jQueryUI library wasn't added to core.

It was, in WP 3.3.

#32 in reply to: ↑ 31 @iandunn
10 years ago

Replying to scribu:

Replying to iandunn:

I don't see why the entire jQueryUI library wasn't added to core.

It was, in WP 3.3.

Ah, sweet :) I must have missed that.

#33 in reply to: ↑ 31 @WraithKenny
10 years ago

Replying to scribu:

Replying to iandunn:

I don't see why the entire jQueryUI library wasn't added to core.

It was, in WP 3.3.

I think he meant the css themes...

#34 @scribu
10 years ago

If he did, there's a ticket for that already: #18909

#35 @jtsternberg
9 years ago

  • Cc justin@… added

+Let's do it!

#36 @ericlewis
9 years ago

  • Cc eric.andrew.lewis@… added

#37 @sillybean
9 years ago

  • Cc steph@… added

#38 in reply to: ↑ 29 @thisislawatts
8 years ago

Replying to WraithKenny:

Please also consider an html5 input[type="date"] with feature detection to fail back onto jQuery UI. Opera is the only decent native datepicker though.

This is also something shipping in Chrome since August 2012 and a quick 'looks at the iPhone' check, shows it is well implemented in iOS 5.x, so if this is added I think applying jQuery UI conditionally has to be the best way right?

Last edited 8 years ago by thisislawatts (previous) (diff)

#39 @Apiweb
8 years ago

  • Severity changed from minor to normal
  • Version 2.7 deleted

Also I think they should always be considered the html5 input [type = "date"] as default and use jQuery as failback.

#40 @markoheijnen
8 years ago

  • Version set to 2.7

My problem I have with html5 input fields is that they aren't consistent in all browsers. So I'm curious how easy it would be to make that so.

#41 @jeremyfelt
8 years ago

  • Focuses ui added

#42 @helen
7 years ago

#28527 was marked as a duplicate.

#45 @ericlewis
7 years ago

If we ever end up doing this, I'd like to know that it's still quick to assign a post to, say, June 13th, 1968. For some use cases, you just can't beat a text input field.

#46 @iseulde
7 years ago

Related: #29420.

#47 @johnjamesjacoby
6 years ago

Styling efforts in #33727.

This ticket was mentioned in Slack in #core-editor by iseulde. View the logs.


6 years ago

#49 @herbertwest1
3 years ago

Hello,

In 2018, couldn't please reconsider not having a UX calendar in the core Wordpress in order to chose the publication date instead of manually putting a date?
I personnally believe that it's a lot better and easier for users to see which DAY their post will be programmed for : not specifically a date, but also knowing that it will be on a tuesday, will help the editorial decisions.

Thanks !

#51 @desrosj
3 years ago

#11942 was marked as a duplicate.

#52 @johnbillion
4 weeks ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from assigned to closed

In the block editor we have a React component for choosing the post date from a calendar. Closing this off as the classic editor is not going to be seeing such enhancements now.

Note: See TracTickets for help on using tickets.