Sha256: 20dd639089d801af90aa7a24888524523e8769d978dfb8d554cdbece6dad8a6a
Contents?: true
Size: 476 Bytes
Versions: 58
Compression:
Stored size: 476 Bytes
Contents
# frozen_string_literal: true module Worldwide class TimeFormatter def initialize(locale: I18n.locale) @locale = locale end def hour_minute_separator format_string = Worldwide::Cldr.t("time.formats.time_only", locale: @locale) /%\-?\d?\d?[Akl](.*)%\-?\d?\d?M/.match(format_string)&.captures&.first || ":" end def twelve_hour_clock? Worldwide::Cldr.t("time.formats.time_only", locale: @locale)&.include?("%P") end end end
Version data entries
58 entries across 58 versions & 1 rubygems