Commit 9b448dac authored by Dylan Araps's avatar Dylan Araps

Date: Simplify math

parent eebef409
...@@ -3018,8 +3018,8 @@ convert_time() { ...@@ -3018,8 +3018,8 @@ convert_time() {
# Calculate day of week. # Calculate day of week.
# Source: http://blog.artofmemory.com/how-to-calculate-the-day-of-the-week-4203.html # Source: http://blog.artofmemory.com/how-to-calculate-the-day-of-the-week-4203.html
year_code="$((${year/??} + $((${year/??} / 4)) % 7))" year_code="$((${year/??} + (${year/??} / 4) % 7))"
week_day="$(($((year_code + month_code + 6 + day - ${leap_code:-0})) % 7))" week_day="$(((year_code + month_code + 6 + day - leap_code) % 7))"
case "$week_day" in case "$week_day" in
0) week_day="Sun" ;; 0) week_day="Sun" ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment