Commit 9c38458f authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Added an option to choose the date format: language based (as defined in each…

Added an option to choose the date format: language based (as defined in each lang file) or ISO 8601 (YYYY-MM-DD).
This option can be set in Admin -> Settings.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@585 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 98cf3307
...@@ -78,11 +78,16 @@ module ApplicationHelper ...@@ -78,11 +78,16 @@ module ApplicationHelper
end end
def format_date(date) def format_date(date)
l_date(date) if date return nil unless date
@date_format_setting ||= Setting.date_format.to_i
@date_format_setting == 0 ? l_date(date) : date.strftime("%Y-%m-%d")
end end
def format_time(time) def format_time(time)
l_datetime((time.is_a? String) ? time.to_time : time) if time return nil unless time
@date_format_setting ||= Setting.date_format.to_i
time = time.to_time if time.is_a?(String)
@date_format_setting == 0 ? l_datetime(time) : (time.strftime("%Y-%m-%d") + ' ' + l_time(time))
end end
def day_name(day) def day_name(day)
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
<p><label><%= l(:setting_default_language) %></label> <p><label><%= l(:setting_default_language) %></label>
<%= select_tag 'settings[default_language]', options_for_select( lang_options_for_select(false), Setting.default_language) %></p> <%= select_tag 'settings[default_language]', options_for_select( lang_options_for_select(false), Setting.default_language) %></p>
<p><label><%= l(:setting_date_format) %></label>
<%= select_tag 'settings[date_format]', options_for_select( [[l(:label_language_based), '0'], ['ISO 8601 (YYYY-MM-DD)', '1']], Setting.date_format) %></p>
<p><label><%= l(:setting_attachment_max_size) %></label> <p><label><%= l(:setting_attachment_max_size) %></label>
<%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB</p> <%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB</p>
......
...@@ -66,3 +66,9 @@ commit_fix_status_id: ...@@ -66,3 +66,9 @@ commit_fix_status_id:
autologin: autologin:
format: int format: int
default: 0 default: 0
# date format
# 0: language based
# 1: ISO format
date_format:
format: int
default: 0
...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Разрешаване на WS за управлени ...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Разрешаване на WS за управлени
setting_commit_ref_keywords: Отбелязващи ключови думи setting_commit_ref_keywords: Отбелязващи ключови думи
setting_commit_fix_keywords: Приключващи ключови думи setting_commit_fix_keywords: Приключващи ключови думи
setting_autologin: Autologin setting_autologin: Autologin
setting_date_format: Date format
label_user: Потребител label_user: Потребител
label_user_plural: Потребители label_user_plural: Потребители
...@@ -402,6 +403,7 @@ label_month: Month ...@@ -402,6 +403,7 @@ label_month: Month
label_week: Week label_week: Week
label_date_from: From label_date_from: From
label_date_to: To label_date_to: To
label_language_based: Language based
button_login: Вход button_login: Вход
button_submit: Изпращане button_submit: Изпращане
......
...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management ...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management
setting_commit_ref_keywords: Referencing keywords setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin setting_autologin: Autologin
setting_date_format: Date format
label_user: Benutzer label_user: Benutzer
label_user_plural: Benutzer label_user_plural: Benutzer
...@@ -402,6 +403,7 @@ label_month: Month ...@@ -402,6 +403,7 @@ label_month: Month
label_week: Week label_week: Week
label_date_from: From label_date_from: From
label_date_to: To label_date_to: To
label_language_based: Language based
button_login: Einloggen button_login: Einloggen
button_submit: OK button_submit: OK
......
...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management ...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management
setting_commit_ref_keywords: Referencing keywords setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin setting_autologin: Autologin
setting_date_format: Date format
label_user: User label_user: User
label_user_plural: Users label_user_plural: Users
...@@ -402,6 +403,7 @@ label_month: Month ...@@ -402,6 +403,7 @@ label_month: Month
label_week: Week label_week: Week
label_date_from: From label_date_from: From
label_date_to: To label_date_to: To
label_language_based: Language based
button_login: Login button_login: Login
button_submit: Submit button_submit: Submit
......
...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management ...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management
setting_commit_ref_keywords: Referencing keywords setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin setting_autologin: Autologin
setting_date_format: Date format
label_user: Usuario label_user: Usuario
label_user_plural: Usuarios label_user_plural: Usuarios
...@@ -402,6 +403,7 @@ label_month: Month ...@@ -402,6 +403,7 @@ label_month: Month
label_week: Week label_week: Week
label_date_from: From label_date_from: From
label_date_to: To label_date_to: To
label_language_based: Language based
button_login: Conexión button_login: Conexión
button_submit: Someter button_submit: Someter
......
...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Activer les WS pour la gestion des dépôts ...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Activer les WS pour la gestion des dépôts
setting_commit_ref_keywords: Mot-clés de référencement setting_commit_ref_keywords: Mot-clés de référencement
setting_commit_fix_keywords: Mot-clés de résolution setting_commit_fix_keywords: Mot-clés de résolution
setting_autologin: Autologin setting_autologin: Autologin
setting_date_format: Format de date
label_user: Utilisateur label_user: Utilisateur
label_user_plural: Utilisateurs label_user_plural: Utilisateurs
...@@ -402,6 +403,7 @@ label_month: Mois ...@@ -402,6 +403,7 @@ label_month: Mois
label_week: Semaine label_week: Semaine
label_date_from: Du label_date_from: Du
label_date_to: Au label_date_to: Au
label_language_based: Basé sur la langue
button_login: Connexion button_login: Connexion
button_submit: Soumettre button_submit: Soumettre
......
...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Abilita WS per la gestione del repository ...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Abilita WS per la gestione del repository
setting_commit_ref_keywords: Referencing keywords setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin setting_autologin: Autologin
setting_date_format: Date format
label_user: Utente label_user: Utente
label_user_plural: Utenti label_user_plural: Utenti
...@@ -402,6 +403,7 @@ label_month: Month ...@@ -402,6 +403,7 @@ label_month: Month
label_week: Week label_week: Week
label_date_from: From label_date_from: From
label_date_to: To label_date_to: To
label_language_based: Language based
button_login: Login button_login: Login
button_submit: Invia button_submit: Invia
......
...@@ -173,6 +173,7 @@ setting_sys_api_enabled: リポジトリ管理用のWeb Serviceを有効化す ...@@ -173,6 +173,7 @@ setting_sys_api_enabled: リポジトリ管理用のWeb Serviceを有効化す
setting_commit_ref_keywords: 参照用キーワード setting_commit_ref_keywords: 参照用キーワード
setting_commit_fix_keywords: 修正用キーワード setting_commit_fix_keywords: 修正用キーワード
setting_autologin: 自動ログイン setting_autologin: 自動ログイン
setting_date_format: Date format
label_user: ユーザ label_user: ユーザ
label_user_plural: ユーザ label_user_plural: ユーザ
...@@ -403,6 +404,7 @@ label_month: Month ...@@ -403,6 +404,7 @@ label_month: Month
label_week: Week label_week: Week
label_date_from: From label_date_from: From
label_date_to: To label_date_to: To
label_language_based: Language based
button_login: ログイン button_login: ログイン
button_submit: 変更 button_submit: 変更
......
...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Gebruik WS voor repository beheer ...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Gebruik WS voor repository beheer
setting_commit_ref_keywords: Referencing keywords setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin setting_autologin: Autologin
setting_date_format: Date format
label_user: Gebruiker label_user: Gebruiker
label_user_plural: Gebruikers label_user_plural: Gebruikers
...@@ -402,6 +403,7 @@ label_month: Month ...@@ -402,6 +403,7 @@ label_month: Month
label_week: Week label_week: Week
label_date_from: From label_date_from: From
label_date_to: To label_date_to: To
label_language_based: Language based
button_login: Inloggen button_login: Inloggen
button_submit: Toevoegen button_submit: Toevoegen
......
...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Ativa WS para gerenciamento do repositorio ...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Ativa WS para gerenciamento do repositorio
setting_commit_ref_keywords: Referencing keywords setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin setting_autologin: Autologin
setting_date_format: Date format
label_user: Usuario label_user: Usuario
label_user_plural: Usuarios label_user_plural: Usuarios
...@@ -402,6 +403,7 @@ label_month: Month ...@@ -402,6 +403,7 @@ label_month: Month
label_week: Week label_week: Week
label_date_from: From label_date_from: From
label_date_to: To label_date_to: To
label_language_based: Language based
button_login: Login button_login: Login
button_submit: Enviar button_submit: Enviar
......
...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Ativa WS para gerenciamento do repositório ...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Ativa WS para gerenciamento do repositório
setting_commit_ref_keywords: Palavras-chave de referôncia setting_commit_ref_keywords: Palavras-chave de referôncia
setting_commit_fix_keywords: Palavras-chave fixas setting_commit_fix_keywords: Palavras-chave fixas
setting_autologin: Autologin setting_autologin: Autologin
setting_date_format: Date format
label_user: Usuário label_user: Usuário
label_user_plural: Usuários label_user_plural: Usuários
...@@ -402,6 +403,7 @@ label_month: Month ...@@ -402,6 +403,7 @@ label_month: Month
label_week: Week label_week: Week
label_date_from: From label_date_from: From
label_date_to: To label_date_to: To
label_language_based: Language based
button_login: Login button_login: Login
button_submit: Enviar button_submit: Enviar
......
...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Aktivera WS för repository management ...@@ -172,6 +172,7 @@ setting_sys_api_enabled: Aktivera WS för repository management
setting_commit_ref_keywords: Referencing keywords setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin setting_autologin: Autologin
setting_date_format: Date format
label_user: Användare label_user: Användare
label_user_plural: Användare label_user_plural: Användare
...@@ -402,6 +403,7 @@ label_month: Month ...@@ -402,6 +403,7 @@ label_month: Month
label_week: Week label_week: Week
label_date_from: From label_date_from: From
label_date_to: To label_date_to: To
label_language_based: Language based
button_login: Logga in button_login: Logga in
button_submit: Skicka button_submit: Skicka
......
...@@ -175,6 +175,7 @@ setting_sys_api_enabled: Enable WS for repository management ...@@ -175,6 +175,7 @@ setting_sys_api_enabled: Enable WS for repository management
setting_commit_ref_keywords: Referencing keywords setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin setting_autologin: Autologin
setting_date_format: Date format
label_user: 用户 label_user: 用户
label_user_plural: 用户列表 label_user_plural: 用户列表
...@@ -404,6 +405,7 @@ label_month: Month ...@@ -404,6 +405,7 @@ label_month: Month
label_week: Week label_week: Week
label_date_from: From label_date_from: From
label_date_to: To label_date_to: To
label_language_based: Language based
button_login: 登录 button_login: 登录
button_submit: 提交 button_submit: 提交
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment