Sha256: 4331fb4a4029645e2b15c445a30e496509a3793777bf24e41daad71f0f646d8a

Contents?: true

Size: 865 Bytes

Versions: 19

Compression:

Stored size: 865 Bytes

Contents

# -*- encoding: utf-8 -*-
# -*- frozen_string_literal: true -*-
# -*- warn_indent: true -*-

UnitMeasurements::Time = UnitMeasurements.build do
  primitive "s"

  system :metric do
    si_unit "s", aliases: ["sec", "second", "seconds"]

    unit "min", value: "60 s", aliases: ["minute", "minutes"]
  end

  unit "h", value: "60 min", aliases: ["hr", "hour", "hours"]
  unit "d", value: "24 h", aliases: ["day", "days"]
  unit "wk", value: "7 d", aliases: ["week", "weeks"]
  unit "mo", value: "30.4167 d", aliases: ["month", "months"]
  unit "yr", value: "365 d", aliases: ["y", "year", "years"]
  unit "ftn", value: "2 wk", aliases: ["4tnite", "fortnight", "fortnights"]
  unit "qtr", value: "3 mo", aliases: ["quarter", "quarters"]
  unit "dec", value: "10 y", aliases: ["decade", "decades"]
  unit "cent", value: "10 dec", aliases: ["century", "centuries"]
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
unit_measurements-5.4.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-5.3.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-5.2.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-5.1.1 lib/unit_measurements/unit_groups/time.rb
unit_measurements-5.1.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-5.0.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.12.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.11.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.10.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.9.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.8.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.7.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.6.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.5.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.4.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.3.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.2.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.1.0 lib/unit_measurements/unit_groups/time.rb
unit_measurements-4.0.0 lib/unit_measurements/unit_groups/time.rb