Skip to content

Commit

Permalink
Editorial: Simplify MonthFromTime
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 committed Sep 4, 2019
1 parent 6fa7af6 commit 96d51c8
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -26956,17 +26956,10 @@ <h1>MonthFromTime ( _t_ )</h1>
<emu-alg>
1. Let _day_ be DayWithinYear(_t_).
1. Let _inLeapYear_ be InLeapYear(_t_).
1. If _day_ &lt; DaysWithinYearBeforeMonth(1, _inLeapYear_), return 0.
1. If _day_ &lt; DaysWithinYearBeforeMonth(2, _inLeapYear_), return 1.
1. If _day_ &lt; DaysWithinYearBeforeMonth(3, _inLeapYear_), return 2.
1. If _day_ &lt; DaysWithinYearBeforeMonth(4, _inLeapYear_), return 3.
1. If _day_ &lt; DaysWithinYearBeforeMonth(5, _inLeapYear_), return 4.
1. If _day_ &lt; DaysWithinYearBeforeMonth(6, _inLeapYear_), return 5.
1. If _day_ &lt; DaysWithinYearBeforeMonth(7, _inLeapYear_), return 6.
1. If _day_ &lt; DaysWithinYearBeforeMonth(8, _inLeapYear_), return 7.
1. If _day_ &lt; DaysWithinYearBeforeMonth(9, _inLeapYear_), return 8.
1. If _day_ &lt; DaysWithinYearBeforeMonth(10, _inLeapYear_), return 9.
1. If _day_ &lt; DaysWithinYearBeforeMonth(11, _inLeapYear_), return 10.
1. Let _month_ be 0.
1. Repeat, while _month_ &lt; 11
1. If _day_ &lt; DaysWithinYearBeforeMonth(_month_ + 1, _inLeapYear_), return _month_.
1. Set _month_ to _month_ + 1.
1. Return 11.
</emu-alg>
</emu-clause>
Expand Down

0 comments on commit 96d51c8

Please sign in to comment.