2018-08-02 00:09:29 +02:00
|
|
|
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Jeremy Lecour <jlecour@evolix.fr>, 2018 Evolix <info@evolix.fr>
|
|
|
|
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
|
|
|
|
2018-05-23 10:32:04 +02:00
|
|
|
module ApplicationHelper
|
2018-07-04 12:33:50 +02:00
|
|
|
def format_date(time, format: :long)
|
|
|
|
l(time.utc.to_date, format: format)
|
|
|
|
end
|
|
|
|
|
2018-06-04 14:07:58 +02:00
|
|
|
def format_utc(time, format: :default)
|
|
|
|
l(time.utc, format: format)
|
|
|
|
end
|
2018-06-13 20:28:37 +02:00
|
|
|
|
|
|
|
def available_locales_collection
|
2018-06-13 22:11:04 +02:00
|
|
|
I18n.available_locales.map { |k| [t("shared.locales.#{k}"), k] }
|
2018-06-13 20:28:37 +02:00
|
|
|
end
|
2018-05-23 10:32:04 +02:00
|
|
|
end
|