Documentation

Std.Time.Date.Unit.Month

Ordinal represents a bounded value for months, which ranges between 1 and 12.

Equations
Instances For

    Offset represents an offset in months. It is defined as an Int.

    Equations
    Instances For

      Quarter represents a value between 1 and 4, inclusive, corresponding to the four quarters of a year.

      Equations
      Instances For
        @[inline]

        Creates an Offset from a natural number.

        Equations
        Instances For
          @[inline]

          Creates an Offset from an integer.

          Equations
          Instances For
            @[inline]

            The ordinal value representing the month of January.

            Equations
            Instances For
              @[inline]

              The ordinal value representing the month of February.

              Equations
              Instances For
                @[inline]

                The ordinal value representing the month of March.

                Equations
                Instances For
                  @[inline]

                  The ordinal value representing the month of April.

                  Equations
                  Instances For
                    @[inline]

                    The ordinal value representing the month of May.

                    Equations
                    Instances For
                      @[inline]

                      The ordinal value representing the month of June.

                      Equations
                      Instances For
                        @[inline]

                        The ordinal value representing the month of July.

                        Equations
                        Instances For
                          @[inline]

                          The ordinal value representing the month of August.

                          Equations
                          Instances For
                            @[inline]

                            The ordinal value representing the month of September.

                            Equations
                            Instances For
                              @[inline]

                              The ordinal value representing the month of October.

                              Equations
                              Instances For
                                @[inline]

                                The ordinal value representing the month of November.

                                Equations
                                Instances For
                                  @[inline]

                                  The ordinal value representing the month of December.

                                  Equations
                                  Instances For
                                    @[inline]

                                    Converts a Ordinal into a Offset.

                                    Equations
                                    • month.toOffset = month.val
                                    Instances For
                                      @[inline]
                                      def Std.Time.Month.Ordinal.ofInt (data : Int) (h : 1 data data 12) :

                                      Creates an Ordinal from an integer, ensuring the value is within bounds.

                                      Equations
                                      Instances For
                                        @[inline]
                                        def Std.Time.Month.Ordinal.ofNat (data : Nat) (h : data 1 data 12 := by decide) :

                                        Creates an Ordinal from a Nat, ensuring the value is within bounds.

                                        Equations
                                        Instances For
                                          @[inline]

                                          Converts a Ordinal into a Nat.

                                          Equations
                                          Instances For
                                            @[inline]

                                            Creates an Ordinal from a Fin, ensuring the value is within bounds, if its 0 then its converted to 1.

                                            Equations
                                            Instances For

                                              Transforms Month.Ordinal into Second.Offset.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For

                                                Gets the number of days in a month.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  theorem Std.Time.Month.Ordinal.days_gt_27 (leap : Bool) (i : Ordinal) :
                                                  days leap i > 27

                                                  Returns the number of days until the month.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    theorem Std.Time.Month.Ordinal.cumulativeDays_le (leap : Bool) (month : Ordinal) :
                                                    cumulativeDays leap month 0 cumulativeDays leap month 334 + if leap = true then 1 else 0
                                                    theorem Std.Time.Month.Ordinal.difference_eq {leap : Bool} {month : Ordinal} (p : month.val 11) :
                                                    let next := (Internal.Bounded.LE.truncateTop month p).addTop 1 ; (cumulativeDays leap next).val = (cumulativeDays leap month).val + (days leap month).val
                                                    @[reducible, inline]
                                                    abbrev Std.Time.Month.Ordinal.Valid (leap : Bool) (month : Ordinal) (day : Day.Ordinal) :

                                                    Checks if a given day is valid for the specified month and year. For example, 29/02 is valid only if the year is a leap year.

                                                    Equations
                                                    Instances For
                                                      @[inline]

                                                      Clips the day to be within the valid range.

                                                      Equations
                                                      Instances For
                                                        theorem Std.Time.Month.Ordinal.valid_clipDay {leap : Bool} {month : Ordinal} {day : Day.Ordinal} :
                                                        Valid leap month (clipDay leap month day)

                                                        Proves that every value provided by a clipDay is a valid day in a year.