Documentation

Std.Time.Date.Unit.Month

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

Instances For
    @[implicit_reducible]
    @[implicit_reducible]
    @[implicit_reducible]
    @[implicit_reducible]
    @[implicit_reducible]
    @[implicit_reducible]
    @[implicit_reducible]

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

    Instances For
      @[implicit_reducible]
      @[implicit_reducible]
      @[implicit_reducible]
      @[implicit_reducible]
      @[implicit_reducible]
      @[implicit_reducible]
      @[implicit_reducible]
      @[implicit_reducible]
      @[implicit_reducible]
      @[implicit_reducible]
      @[implicit_reducible]
      @[implicit_reducible]

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

      Instances For
        @[implicit_reducible]
        @[implicit_reducible]
        @[implicit_reducible]
        @[implicit_reducible]
        @[implicit_reducible]

        Determine the Quarter by the month.

        Instances For
          @[inline]

          Creates an Offset from a natural number.

          Instances For
            @[inline]

            Creates an Offset from an integer.

            Instances For
              @[inline]

              The ordinal value representing the month of January.

              Instances For
                @[inline]

                The ordinal value representing the month of February.

                Instances For
                  @[inline]

                  The ordinal value representing the month of March.

                  Instances For
                    @[inline]

                    The ordinal value representing the month of April.

                    Instances For
                      @[inline]

                      The ordinal value representing the month of May.

                      Instances For
                        @[inline]

                        The ordinal value representing the month of June.

                        Instances For
                          @[inline]

                          The ordinal value representing the month of July.

                          Instances For
                            @[inline]

                            The ordinal value representing the month of August.

                            Instances For
                              @[inline]

                              The ordinal value representing the month of September.

                              Instances For
                                @[inline]

                                The ordinal value representing the month of October.

                                Instances For
                                  @[inline]

                                  The ordinal value representing the month of November.

                                  Instances For
                                    @[inline]

                                    The ordinal value representing the month of December.

                                    Instances For
                                      @[inline]

                                      Converts a Ordinal into a Offset.

                                      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.

                                        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.

                                          Instances For
                                            @[inline]

                                            Converts a Ordinal into a Nat.

                                            Instances For
                                              @[inline]

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

                                              Instances For

                                                Transforms Month.Ordinal into Second.Offset.

                                                Instances For
                                                  @[inline]

                                                  Transforms Month.Ordinal into Minute.Offset.

                                                  Instances For
                                                    @[inline]

                                                    Transforms Month.Ordinal into Hour.Offset.

                                                    Instances For
                                                      @[inline]

                                                      Transforms Month.Ordinal into Day.Offset.

                                                      Instances For

                                                        Gets the number of days in a month.

                                                        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.

                                                          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) :
                                                            have next := (Internal.Bounded.LE.truncateTop month p).addTop 1 difference_eq._proof_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.

                                                            Instances For
                                                              @[inline]

                                                              Clips the day to be within the valid range.

                                                              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.