Skip to content

Commit

Permalink
Date/Time: Use numeric input for touch_time() fields.
Browse files Browse the repository at this point in the history
This aims to make it easier to enter digits in datetime text fields on mobile devices, instead of opening the full keyboard.

Follow-up to [43], [1506], [2998], [3648], [6078], [6989], [7285], [7338], [20168], [20217], [28730], [32945], [49283].

Props sabernhardt.
Fixes #62109.

git-svn-id: https://develop.svn.wordpress.org/trunk@59114 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Sep 29, 2024
1 parent ef03b7a commit 2cd811f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/wp-admin/includes/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -850,19 +850,19 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
$day = '<label><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Day' ) .
'</span><input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
'</span><input type="text" ' . ( $multi ? '' : 'id="jj" ' ) . 'name="jj" value="' . $jj . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>';
$year = '<label><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Year' ) .
'</span><input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
'</span><input type="text" ' . ( $multi ? '' : 'id="aa" ' ) . 'name="aa" value="' . $aa . '" size="4" maxlength="4"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>';
$hour = '<label><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Hour' ) .
'</span><input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
'</span><input type="text" ' . ( $multi ? '' : 'id="hh" ' ) . 'name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>';
$minute = '<label><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Minute' ) .
'</span><input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" /></label>';
'</span><input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" class="form-required" inputmode="numeric" /></label>';

echo '<div class="timestamp-wrap">';
/* translators: 1: Month, 2: Day, 3: Year, 4: Hour, 5: Minute. */
Expand Down

0 comments on commit 2cd811f

Please sign in to comment.