Permalink
Browse files

Time format hint (Editor)

  • Loading branch information...
1 parent ef3eb90 commit 10bb2b1526c67ca6379c2ed526bb683814e2a9be @vrana committed Mar 18, 2011
Showing with 11 additions and 1 deletion.
  1. +2 −0 adminer/lang/cs.inc.php
  2. +1 −0 changes.txt
  3. +8 −1 editor/include/adminer.inc.php
View
@@ -281,6 +281,8 @@
'$1-$3-$5' => '$6.$4.$1',
// hint for date format - use language equivalents for day, month and year shortcuts
'[yyyy]-mm-dd' => 'd.m.[rrrr]',
+ // hint for time format - use language equivalents for hour, minute and second shortcuts
+ 'HH:MM:SS' => 'HH:MM:SS',
'now' => 'teď',
// general SQLite error in create, drop or rename database
View
@@ -12,6 +12,7 @@ Set MySQL time zone by PHP setting
Disable maxlength with functions in edit
Better placement of AJAX icon
Table header in CSV export (Editor)
+Time format hint (Editor)
Polish translation
Adminer 3.2.0 (released 2011-02-24):
@@ -420,8 +420,15 @@ function editInput($table, $field, $attrs, $value) {
if (ereg("(tinyint|bit)\\(1\\)", $field["full_type"])) { // bool
return '<input type="checkbox" value="' . h($value ? $value : 1) . '"' . ($value ? ' checked' : '') . "$attrs>";
}
+ $hint = "";
+ if (ereg('time', $field["type"])) {
+ $hint = lang('HH:MM:SS');
+ }
if (ereg('date|timestamp', $field["type"])) {
- return "<input value='" . h($value) . "'$attrs> (" . lang('[yyyy]-mm-dd') . ")"; //! maxlength
+ $hint = lang('[yyyy]-mm-dd') . ($hint ? " [$hint]" : "");
+ }
+ if ($hint) {
+ return "<input value='" . h($value) . "'$attrs> ($hint)"; //! maxlength
}
if (eregi('_(md5|sha1)$', $field["field"])) {
return "<input type='password' value='" . h($value) . "'$attrs>";

0 comments on commit 10bb2b1

Please sign in to comment.