From 5ebb018cb895a8ae6a52f6bdd9606e4bd5df83e4 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Tue, 24 Apr 2007 00:11:20 +0000 Subject: [PATCH] #10067 Never noticed the date output in the dropdown was dynamic... so made sense to actually use the relative days feature to _actually show_ how it works by placing "Today" within the date, and append it with a date of how it'd be formatted it it wasn't yesterday/today/tomorrow by offsetting the time() by 1 year negatively. Bonus is that the RELATIVE_DAYS variable is no longer needed, though have switched that for a VARIANT_DATE_SEPARATOR variable incase people want to localise " / " (could have been hardcoded, but you never know! :P) The YESTERDAY/TODAY/TOMORROW variables have also had their trailing commas nuked (the comma has gone into the date format code) as people whom want: "d M Y @ H:i:s" => "01 Jan 2007 @ 13:37:00" ... enabling relative days with: "|d M Y| @ H:i:s" ... would have got: "Today, @ 13:37:00" ... but now they shall get: "Today @ 13:37:00" Lastly, added a relative date option for those prefering middle-endian dates with am/pm time. git-svn-id: file:///svn/phpbb/trunk@7391 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 2 +- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/ucp/ucp_prefs.php | 2 +- phpBB/language/en/acp/board.php | 1 - phpBB/language/en/common.php | 14 ++++++++------ phpBB/language/en/ucp.php | 1 - 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 8f29fdf43f..d3a6e9da6f 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -767,7 +767,7 @@ class acp_board foreach ($user->lang['dateformats'] as $format => $null) { $dateformat_options .= ''; } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 5df9c418dc..d3dd8ee7c3 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1235,7 +1235,7 @@ class acp_users foreach ($user->lang['dateformats'] as $format => $null) { $dateformat_options .= ''; } diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index e0c6ee3e84..07fa954d16 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -94,7 +94,7 @@ class ucp_prefs foreach ($user->lang['dateformats'] as $format => $null) { $dateformat_options .= ''; } diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 16030b81f4..416e041706 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -42,7 +42,6 @@ $lang = array_merge($lang, array( 'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users. You can also enter a short (255 character) message to display if you wish.', 'OVERRIDE_STYLE' => 'Override user style', 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s style with the default.', - 'RELATIVE_DAYS' => 'Relative days', 'SITE_DESC' => 'Site description', 'SITE_NAME' => 'Site name', 'SYSTEM_DST' => 'Enable Summer Time/DST', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index c0d2fa4619..d7bfa6a613 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -593,6 +593,7 @@ $lang = array_merge($lang, array( 'USERS' => 'Users', 'USE_PERMISSIONS' => 'Test out user’s permissions', + 'VARIANT_DATE_SEPARATOR' => ' / ', // Used in date format dropdown, eg: "Today, 13:37 / 01 Jan 2007, 13:37" ... to join a relative date with calendar date 'VIEWED' => 'Viewed', 'VIEWING_FAQ' => 'Viewing FAQ', 'VIEWING_MEMBERS' => 'Viewing member details', @@ -642,9 +643,9 @@ $lang = array_merge($lang, array( 'YOU_NO_NEW_PM' => 'No new private messages are waiting for you', 'datetime' => array( - 'TODAY' => 'Today, ', - 'TOMORROW' => 'Tomorrow, ', - 'YESTERDAY' => 'Yesterday, ', + 'TODAY' => 'Today', + 'TOMORROW' => 'Tomorrow', + 'YESTERDAY' => 'Yesterday', 'Sunday' => 'Sunday', 'Monday' => 'Monday', @@ -776,12 +777,13 @@ $lang = array_merge($lang, array( // The value is only an example and will get replaced by the current time on view 'dateformats' => array( - '|d M Y| H:i' => '01 Jan 2007 13:37 [Relative days]', + '|d M Y|, H:i' => 'Today, 13:37 / 01 Jan 2007, 13:37', 'd M Y, H:i' => '01 Jan 2007, 13:37', 'd M Y H:i' => '01 Jan 2007 13:37', + 'M jS, \'y, H:i' => 'Jan 1st, \'07, 13:37', 'D M d, Y g:i a' => 'Mon Jan 01, 2007 1:37 pm', - 'M jS, y, H:i' => 'Jan 1st, 07, 1:37 pm', - 'F jS, Y, g:i a' => 'January 1st, 2007, 1:37 pm' + 'F jS, Y, g:i a' => 'January 1st, 2007, 1:37 pm', + '|F jS, Y|, g:i a' => 'Today, 1:37 pm / January 1st, 2007, 1:37 pm' ), // The default dateformat which will be used on new installs in this language diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index c7eb71998e..d794efdf5a 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -340,7 +340,6 @@ $lang = array_merge($lang, array( 'RECIPIENT' => 'Recipient', 'RECIPIENTS' => 'Recipients', 'REGISTRATION' => 'Registration', - 'RELATIVE_DAYS' => 'Relative days', 'RELEASE_MESSAGES' => '%sRelease all on-hold messages%s… they will be re-sorted into the appropriate folder if enough space is made available.', 'REMOVE_ADDRESS' => 'Remove address', 'REMOVE_SELECTED_BOOKMARKS' => 'Remove selected bookmarks',