diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-09-12 19:56:12 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-09-12 19:56:12 +0000 |
| commit | 990f87ffd02260b360b08fca4f28175f987924b5 (patch) | |
| tree | 381f926e8a24c8575c733066c35bc53d5aa461ac /roundcubemail/program/steps/settings/func.inc | |
| parent | 8d7f15715a2f396533925c3e676ec054b4b374e3 (diff) | |
Make date/time format user configurable; drop 'date_today' config option
git-svn-id: https://svn.roundcube.net/trunk@5210 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/settings/func.inc')
| -rw-r--r-- | roundcubemail/program/steps/settings/func.inc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/roundcubemail/program/steps/settings/func.inc b/roundcubemail/program/steps/settings/func.inc index 9e6b601a1..e6fd9109d 100644 --- a/roundcubemail/program/steps/settings/func.inc +++ b/roundcubemail/program/steps/settings/func.inc @@ -237,6 +237,33 @@ function rcmail_user_prefs($current=null) ); } + // date/time formatting + if (!isset($no_override['time_format'])) { + $reftime = mktime(7,30,0); + $field_id = 'rcmfd_time_format'; + $select_time = new html_select(array('name' => '_time_format', 'id' => $field_id)); + foreach ((array)$RCMAIL->config->get('time_formats', array('G:i', 'H:i', 'g:i a', 'h:i A')) as $choice) + $select_time->add(date($choice, $reftime), $choice); + + $blocks['main']['options']['time_format'] = array( + 'title' => html::label($field_id, Q(rcube_label('timeformat'))), + 'content' => $select_time->show($RCMAIL->config->get('time_format')), + ); + } + + if (!isset($no_override['date_format'])) { + $refdate = mktime(12,30,0,7,24); + $field_id = 'rcmfd_date_format'; + $select_date = new html_select(array('name' => '_date_format', 'id' => $field_id)); + foreach ((array)$RCMAIL->config->get('date_formats', array('Y-m-d','d-m-Y','Y/m/d','m/d/Y','d/m/Y','d.m.Y','j.n.Y')) as $choice) + $select_date->add(date($choice, $refdate), $choice); + + $blocks['main']['options']['date_format'] = array( + 'title' => html::label($field_id, Q(rcube_label('dateformat'))), + 'content' => $select_date->show($config['date_format']), + ); + } + // MM: Show checkbox for toggling 'pretty dates' if (!isset($no_override['prettydate'])) { $field_id = 'rcmfd_prettydate'; |
