Make WordPress Core

Opened 12 years ago

Closed 10 years ago

#19813 closed enhancement (wontfix)

Keyboard shortcuts for editing posted date

Reported by: tw2113's profile tw2113 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3.1
Component: Date/Time Keywords:
Focuses: Cc:

Description

In short, I thought it would be a nice feature to be able to use the Up/Down arrow keys to increment or decrement the values within the post published date/time input boxes. I found this stackoverflow post with the basics of how to retrieve keystrokes and alter the value based on which one was pressed.

http://stackoverflow.com/questions/7742364/incrementing-value-integer-in-an-input-type-field.

I then altered the code to prevent negative numbers and stay within the limits of each field type.

Days get 1-31
Year gets 1900+
Hours get 0-23
Minutes get 0-59

JS could probably be cleaned up a bit and condensed, but I wasn't quite sure how to separate them all out. Maybe someone with more js-fu can help out with that

Attachments (1)

keyshortcuts.diff (5.8 KB) - added by tw2113 12 years ago.
template.php & utils.js edits

Download all attachments as: .zip

Change History (5)

@tw2113
12 years ago

template.php & utils.js edits

#1 @GaryJ
12 years ago

Why not switch to a number input type, with the new HTML attributes which can handle this validation already? Oldeer browser that don't support it continue with the same experience they get now (since it will fallback to a text type).

#4 @johnbillion
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Closing this off in favour of #7665. This UI is very sub-par. A datepicker is the best way to go.

Note: See TracTickets for help on using tickets.