##// END OF EJS Templates
Added an option to choose the date format: language based (as defined in each lang file) or ISO 8601 (YYYY-MM-DD)....
Jean-Philippe Lang -
r582:9c38458f8bd2
parent child
Show More
@@ -78,11 +78,16 module ApplicationHelper
78 end
78 end
79
79
80 def format_date(date)
80 def format_date(date)
81 l_date(date) if date
81 return nil unless date
82 @date_format_setting ||= Setting.date_format.to_i
83 @date_format_setting == 0 ? l_date(date) : date.strftime("%Y-%m-%d")
82 end
84 end
83
85
84 def format_time(time)
86 def format_time(time)
85 l_datetime((time.is_a? String) ? time.to_time : time) if time
87 return nil unless time
88 @date_format_setting ||= Setting.date_format.to_i
89 time = time.to_time if time.is_a?(String)
90 @date_format_setting == 0 ? l_datetime(time) : (time.strftime("%Y-%m-%d") + ' ' + l_time(time))
86 end
91 end
87
92
88 def day_name(day)
93 def day_name(day)
@@ -15,6 +15,9
15 <p><label><%= l(:setting_default_language) %></label>
15 <p><label><%= l(:setting_default_language) %></label>
16 <%= select_tag 'settings[default_language]', options_for_select( lang_options_for_select(false), Setting.default_language) %></p>
16 <%= select_tag 'settings[default_language]', options_for_select( lang_options_for_select(false), Setting.default_language) %></p>
17
17
18 <p><label><%= l(:setting_date_format) %></label>
19 <%= select_tag 'settings[date_format]', options_for_select( [[l(:label_language_based), '0'], ['ISO 8601 (YYYY-MM-DD)', '1']], Setting.date_format) %></p>
20
18 <p><label><%= l(:setting_attachment_max_size) %></label>
21 <p><label><%= l(:setting_attachment_max_size) %></label>
19 <%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB</p>
22 <%= text_field_tag 'settings[attachment_max_size]', Setting.attachment_max_size, :size => 6 %> KB</p>
20
23
@@ -66,3 +66,9 commit_fix_status_id:
66 autologin:
66 autologin:
67 format: int
67 format: int
68 default: 0
68 default: 0
69 # date format
70 # 0: language based
71 # 1: ISO format
72 date_format:
73 format: int
74 default: 0
@@ -172,6 +172,7 setting_sys_api_enabled: Разрешаване на WS за управлени
172 setting_commit_ref_keywords: Отбелязващи ключови думи
172 setting_commit_ref_keywords: Отбелязващи ключови думи
173 setting_commit_fix_keywords: Приключващи ключови думи
173 setting_commit_fix_keywords: Приключващи ключови думи
174 setting_autologin: Autologin
174 setting_autologin: Autologin
175 setting_date_format: Date format
175
176
176 label_user: Потребител
177 label_user: Потребител
177 label_user_plural: Потребители
178 label_user_plural: Потребители
@@ -402,6 +403,7 label_month: Month
402 label_week: Week
403 label_week: Week
403 label_date_from: From
404 label_date_from: From
404 label_date_to: To
405 label_date_to: To
406 label_language_based: Language based
405
407
406 button_login: Вход
408 button_login: Вход
407 button_submit: Изпращане
409 button_submit: Изпращане
@@ -172,6 +172,7 setting_sys_api_enabled: Enable WS for repository management
172 setting_commit_ref_keywords: Referencing keywords
172 setting_commit_ref_keywords: Referencing keywords
173 setting_commit_fix_keywords: Fixing keywords
173 setting_commit_fix_keywords: Fixing keywords
174 setting_autologin: Autologin
174 setting_autologin: Autologin
175 setting_date_format: Date format
175
176
176 label_user: Benutzer
177 label_user: Benutzer
177 label_user_plural: Benutzer
178 label_user_plural: Benutzer
@@ -402,6 +403,7 label_month: Month
402 label_week: Week
403 label_week: Week
403 label_date_from: From
404 label_date_from: From
404 label_date_to: To
405 label_date_to: To
406 label_language_based: Language based
405
407
406 button_login: Einloggen
408 button_login: Einloggen
407 button_submit: OK
409 button_submit: OK
@@ -172,6 +172,7 setting_sys_api_enabled: Enable WS for repository management
172 setting_commit_ref_keywords: Referencing keywords
172 setting_commit_ref_keywords: Referencing keywords
173 setting_commit_fix_keywords: Fixing keywords
173 setting_commit_fix_keywords: Fixing keywords
174 setting_autologin: Autologin
174 setting_autologin: Autologin
175 setting_date_format: Date format
175
176
176 label_user: User
177 label_user: User
177 label_user_plural: Users
178 label_user_plural: Users
@@ -402,6 +403,7 label_month: Month
402 label_week: Week
403 label_week: Week
403 label_date_from: From
404 label_date_from: From
404 label_date_to: To
405 label_date_to: To
406 label_language_based: Language based
405
407
406 button_login: Login
408 button_login: Login
407 button_submit: Submit
409 button_submit: Submit
@@ -172,6 +172,7 setting_sys_api_enabled: Enable WS for repository management
172 setting_commit_ref_keywords: Referencing keywords
172 setting_commit_ref_keywords: Referencing keywords
173 setting_commit_fix_keywords: Fixing keywords
173 setting_commit_fix_keywords: Fixing keywords
174 setting_autologin: Autologin
174 setting_autologin: Autologin
175 setting_date_format: Date format
175
176
176 label_user: Usuario
177 label_user: Usuario
177 label_user_plural: Usuarios
178 label_user_plural: Usuarios
@@ -402,6 +403,7 label_month: Month
402 label_week: Week
403 label_week: Week
403 label_date_from: From
404 label_date_from: From
404 label_date_to: To
405 label_date_to: To
406 label_language_based: Language based
405
407
406 button_login: Conexión
408 button_login: Conexión
407 button_submit: Someter
409 button_submit: Someter
@@ -172,6 +172,7 setting_sys_api_enabled: Activer les WS pour la gestion des dépôts
172 setting_commit_ref_keywords: Mot-clés de référencement
172 setting_commit_ref_keywords: Mot-clés de référencement
173 setting_commit_fix_keywords: Mot-clés de résolution
173 setting_commit_fix_keywords: Mot-clés de résolution
174 setting_autologin: Autologin
174 setting_autologin: Autologin
175 setting_date_format: Format de date
175
176
176 label_user: Utilisateur
177 label_user: Utilisateur
177 label_user_plural: Utilisateurs
178 label_user_plural: Utilisateurs
@@ -402,6 +403,7 label_month: Mois
402 label_week: Semaine
403 label_week: Semaine
403 label_date_from: Du
404 label_date_from: Du
404 label_date_to: Au
405 label_date_to: Au
406 label_language_based: Basé sur la langue
405
407
406 button_login: Connexion
408 button_login: Connexion
407 button_submit: Soumettre
409 button_submit: Soumettre
@@ -172,6 +172,7 setting_sys_api_enabled: Abilita WS per la gestione del repository
172 setting_commit_ref_keywords: Referencing keywords
172 setting_commit_ref_keywords: Referencing keywords
173 setting_commit_fix_keywords: Fixing keywords
173 setting_commit_fix_keywords: Fixing keywords
174 setting_autologin: Autologin
174 setting_autologin: Autologin
175 setting_date_format: Date format
175
176
176 label_user: Utente
177 label_user: Utente
177 label_user_plural: Utenti
178 label_user_plural: Utenti
@@ -402,6 +403,7 label_month: Month
402 label_week: Week
403 label_week: Week
403 label_date_from: From
404 label_date_from: From
404 label_date_to: To
405 label_date_to: To
406 label_language_based: Language based
405
407
406 button_login: Login
408 button_login: Login
407 button_submit: Invia
409 button_submit: Invia
@@ -173,6 +173,7 setting_sys_api_enabled: リポジトリ管理用のWeb Serviceを有効化す
173 setting_commit_ref_keywords: 参照用キーワード
173 setting_commit_ref_keywords: 参照用キーワード
174 setting_commit_fix_keywords: 修正用キーワード
174 setting_commit_fix_keywords: 修正用キーワード
175 setting_autologin: 自動ログイン
175 setting_autologin: 自動ログイン
176 setting_date_format: Date format
176
177
177 label_user: ユーザ
178 label_user: ユーザ
178 label_user_plural: ユーザ
179 label_user_plural: ユーザ
@@ -403,6 +404,7 label_month: Month
403 label_week: Week
404 label_week: Week
404 label_date_from: From
405 label_date_from: From
405 label_date_to: To
406 label_date_to: To
407 label_language_based: Language based
406
408
407 button_login: ログイン
409 button_login: ログイン
408 button_submit: 変更
410 button_submit: 変更
@@ -172,6 +172,7 setting_sys_api_enabled: Gebruik WS voor repository beheer
172 setting_commit_ref_keywords: Referencing keywords
172 setting_commit_ref_keywords: Referencing keywords
173 setting_commit_fix_keywords: Fixing keywords
173 setting_commit_fix_keywords: Fixing keywords
174 setting_autologin: Autologin
174 setting_autologin: Autologin
175 setting_date_format: Date format
175
176
176 label_user: Gebruiker
177 label_user: Gebruiker
177 label_user_plural: Gebruikers
178 label_user_plural: Gebruikers
@@ -402,6 +403,7 label_month: Month
402 label_week: Week
403 label_week: Week
403 label_date_from: From
404 label_date_from: From
404 label_date_to: To
405 label_date_to: To
406 label_language_based: Language based
405
407
406 button_login: Inloggen
408 button_login: Inloggen
407 button_submit: Toevoegen
409 button_submit: Toevoegen
@@ -172,6 +172,7 setting_sys_api_enabled: Ativa WS para gerenciamento do repositorio
172 setting_commit_ref_keywords: Referencing keywords
172 setting_commit_ref_keywords: Referencing keywords
173 setting_commit_fix_keywords: Fixing keywords
173 setting_commit_fix_keywords: Fixing keywords
174 setting_autologin: Autologin
174 setting_autologin: Autologin
175 setting_date_format: Date format
175
176
176 label_user: Usuario
177 label_user: Usuario
177 label_user_plural: Usuarios
178 label_user_plural: Usuarios
@@ -402,6 +403,7 label_month: Month
402 label_week: Week
403 label_week: Week
403 label_date_from: From
404 label_date_from: From
404 label_date_to: To
405 label_date_to: To
406 label_language_based: Language based
405
407
406 button_login: Login
408 button_login: Login
407 button_submit: Enviar
409 button_submit: Enviar
@@ -172,6 +172,7 setting_sys_api_enabled: Ativa WS para gerenciamento do repositório
172 setting_commit_ref_keywords: Palavras-chave de referôncia
172 setting_commit_ref_keywords: Palavras-chave de referôncia
173 setting_commit_fix_keywords: Palavras-chave fixas
173 setting_commit_fix_keywords: Palavras-chave fixas
174 setting_autologin: Autologin
174 setting_autologin: Autologin
175 setting_date_format: Date format
175
176
176 label_user: Usuário
177 label_user: Usuário
177 label_user_plural: Usuários
178 label_user_plural: Usuários
@@ -402,6 +403,7 label_month: Month
402 label_week: Week
403 label_week: Week
403 label_date_from: From
404 label_date_from: From
404 label_date_to: To
405 label_date_to: To
406 label_language_based: Language based
405
407
406 button_login: Login
408 button_login: Login
407 button_submit: Enviar
409 button_submit: Enviar
@@ -172,6 +172,7 setting_sys_api_enabled: Aktivera WS för repository management
172 setting_commit_ref_keywords: Referencing keywords
172 setting_commit_ref_keywords: Referencing keywords
173 setting_commit_fix_keywords: Fixing keywords
173 setting_commit_fix_keywords: Fixing keywords
174 setting_autologin: Autologin
174 setting_autologin: Autologin
175 setting_date_format: Date format
175
176
176 label_user: Användare
177 label_user: Användare
177 label_user_plural: Användare
178 label_user_plural: Användare
@@ -402,6 +403,7 label_month: Month
402 label_week: Week
403 label_week: Week
403 label_date_from: From
404 label_date_from: From
404 label_date_to: To
405 label_date_to: To
406 label_language_based: Language based
405
407
406 button_login: Logga in
408 button_login: Logga in
407 button_submit: Skicka
409 button_submit: Skicka
@@ -175,6 +175,7 setting_sys_api_enabled: Enable WS for repository management
175 setting_commit_ref_keywords: Referencing keywords
175 setting_commit_ref_keywords: Referencing keywords
176 setting_commit_fix_keywords: Fixing keywords
176 setting_commit_fix_keywords: Fixing keywords
177 setting_autologin: Autologin
177 setting_autologin: Autologin
178 setting_date_format: Date format
178
179
179 label_user: 用户
180 label_user: 用户
180 label_user_plural: 用户列表
181 label_user_plural: 用户列表
@@ -404,6 +405,7 label_month: Month
404 label_week: Week
405 label_week: Week
405 label_date_from: From
406 label_date_from: From
406 label_date_to: To
407 label_date_to: To
408 label_language_based: Language based
407
409
408 button_login: 登录
410 button_login: 登录
409 button_submit: 提交
411 button_submit: 提交
General Comments 0
You need to be logged in to leave comments. Login now