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
This commit is contained in:
Jean-Philippe Lang 2007-07-14 13:29:20 +00:00
parent 98cf33070f
commit 9c38458f8b
15 changed files with 40 additions and 2 deletions

View File

@ -78,11 +78,16 @@ module ApplicationHelper
end
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
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
def day_name(day)

View File

@ -15,6 +15,9 @@
<p><label><%= l(:setting_default_language) %></label>
<%= 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>
<%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB</p>

View File

@ -66,3 +66,9 @@ commit_fix_status_id:
autologin:
format: int
default: 0
# date format
# 0: language based
# 1: ISO format
date_format:
format: int
default: 0

View File

@ -172,6 +172,7 @@ setting_sys_api_enabled: Разрешаване на WS за управлени
setting_commit_ref_keywords: Отбелязващи ключови думи
setting_commit_fix_keywords: Приключващи ключови думи
setting_autologin: Autologin
setting_date_format: Date format
label_user: Потребител
label_user_plural: Потребители
@ -402,6 +403,7 @@ label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: Language based
button_login: Вход
button_submit: Изпращане

View File

@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management
setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin
setting_date_format: Date format
label_user: Benutzer
label_user_plural: Benutzer
@ -402,6 +403,7 @@ label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: Language based
button_login: Einloggen
button_submit: OK

View File

@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management
setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin
setting_date_format: Date format
label_user: User
label_user_plural: Users
@ -402,6 +403,7 @@ label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: Language based
button_login: Login
button_submit: Submit

View File

@ -172,6 +172,7 @@ setting_sys_api_enabled: Enable WS for repository management
setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin
setting_date_format: Date format
label_user: Usuario
label_user_plural: Usuarios
@ -402,6 +403,7 @@ label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: Language based
button_login: Conexión
button_submit: Someter

View File

@ -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_fix_keywords: Mot-clés de résolution
setting_autologin: Autologin
setting_date_format: Format de date
label_user: Utilisateur
label_user_plural: Utilisateurs
@ -402,6 +403,7 @@ label_month: Mois
label_week: Semaine
label_date_from: Du
label_date_to: Au
label_language_based: Basé sur la langue
button_login: Connexion
button_submit: Soumettre

View File

@ -172,6 +172,7 @@ setting_sys_api_enabled: Abilita WS per la gestione del repository
setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin
setting_date_format: Date format
label_user: Utente
label_user_plural: Utenti
@ -402,6 +403,7 @@ label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: Language based
button_login: Login
button_submit: Invia

View File

@ -173,6 +173,7 @@ setting_sys_api_enabled: リポジトリ管理用のWeb Serviceを有効化す
setting_commit_ref_keywords: 参照用キーワード
setting_commit_fix_keywords: 修正用キーワード
setting_autologin: 自動ログイン
setting_date_format: Date format
label_user: ユーザ
label_user_plural: ユーザ
@ -403,6 +404,7 @@ label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: Language based
button_login: ログイン
button_submit: 変更

View File

@ -172,6 +172,7 @@ setting_sys_api_enabled: Gebruik WS voor repository beheer
setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin
setting_date_format: Date format
label_user: Gebruiker
label_user_plural: Gebruikers
@ -402,6 +403,7 @@ label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: Language based
button_login: Inloggen
button_submit: Toevoegen

View File

@ -172,6 +172,7 @@ setting_sys_api_enabled: Ativa WS para gerenciamento do repositorio
setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin
setting_date_format: Date format
label_user: Usuario
label_user_plural: Usuarios
@ -402,6 +403,7 @@ label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: Language based
button_login: Login
button_submit: Enviar

View File

@ -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_fix_keywords: Palavras-chave fixas
setting_autologin: Autologin
setting_date_format: Date format
label_user: Usuário
label_user_plural: Usuários
@ -402,6 +403,7 @@ label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: Language based
button_login: Login
button_submit: Enviar

View File

@ -172,6 +172,7 @@ setting_sys_api_enabled: Aktivera WS för repository management
setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin
setting_date_format: Date format
label_user: Användare
label_user_plural: Användare
@ -402,6 +403,7 @@ label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: Language based
button_login: Logga in
button_submit: Skicka

View File

@ -175,6 +175,7 @@ setting_sys_api_enabled: Enable WS for repository management
setting_commit_ref_keywords: Referencing keywords
setting_commit_fix_keywords: Fixing keywords
setting_autologin: Autologin
setting_date_format: Date format
label_user: 用户
label_user_plural: 用户列表
@ -404,6 +405,7 @@ label_month: Month
label_week: Week
label_date_from: From
label_date_to: To
label_language_based: Language based
button_login: 登录
button_submit: 提交