Packages
ex_cldr_dates_times
2.5.2
2.25.6
2.25.5
2.25.4
2.25.3
2.25.2
2.25.1
2.25.0
2.24.2
2.24.1
2.24.0
2.23.0
2.22.0
2.21.0
2.20.3
2.20.2
2.20.0
2.19.2
2.19.1
2.19.0
retired
2.18.1
2.18.0
2.17.1
2.17.0
2.16.0
2.15.0
2.14.3
2.14.2
2.14.1
2.14.0
2.13.3
2.13.2
2.13.1
2.13.0
2.12.0
2.11.0
2.10.2
2.10.1
2.10.0
2.10.0-rc.3
2.10.0-rc.2
2.10.0-rc.1
2.10.0-rc.0
2.9.4
2.9.3
2.9.2
2.9.1
2.9.0
2.8.0
2.7.2
2.7.1
retired
2.7.0
2.7.0-rc.0
2.6.4
2.6.3
2.6.2
2.6.1
retired
2.6.0
2.6.0-rc.0
2.5.4
2.5.3
2.5.2
2.5.1
2.5.0
2.4.0
2.4.0-rc.0
2.3.0
2.2.4
2.2.3
2.2.2
2.2.1
2.2.0
2.1.0
2.0.2
2.0.1
2.0.0
1.4.0
1.3.1
1.3.0
1.2.1
1.2.0
1.0.1
1.0.0
1.0.0-rc.1
1.0.0-rc.0
retired
0.3.3
0.3.2
retired
0.3.1
retired
0.3.0
0.2.2
0.2.1
0.2.0
0.1.2
0.1.1
0.1.0
Date, Time and DateTime localization, internationalization and formatting functions using the Common Locale Data Repository (CLDR).
Current section
Files
Jump to
Current section
Files
lib/cldr/protocol/cldr_chars.ex
defimpl Cldr.Chars, for: Date do
def to_string(date) do
locale = Cldr.get_locale()
Cldr.Date.to_string!(date, locale.backend, locale: locale)
end
end
defimpl Cldr.Chars, for: Time do
def to_string(date) do
locale = Cldr.get_locale()
Cldr.Time.to_string!(date, locale.backend, locale: locale)
end
end
defimpl Cldr.Chars, for: DateTime do
def to_string(datetime) do
locale = Cldr.get_locale()
Cldr.DateTime.to_string!(datetime, locale.backend, locale: locale)
end
end
defimpl Cldr.Chars, for: NaiveDateTime do
def to_string(datetime) do
locale = Cldr.get_locale()
Cldr.DateTime.to_string!(datetime, locale.backend, locale: locale)
end
end
defimpl Cldr.Chars, for: Date.Range do
def to_string(range) do
locale = Cldr.get_locale()
Cldr.Date.Interval.to_string!(range, locale.backend, locale: locale)
end
end
if Cldr.Code.ensure_compiled?(CalendarInterval) do
defimpl Cldr.Chars, for: CalendarInterval do
def to_string(interval) do
locale = Cldr.get_locale()
Cldr.DateTime.Interval.to_string!(interval, locale.backend, locale: locale)
end
end
end