Skip to content

Commit

Permalink
fix macintosh leap-year
Browse files Browse the repository at this point in the history
  • Loading branch information
hwixley committed Mar 23, 2024
1 parent 9699865 commit 035489d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/commands/leap-year.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash

date=$(date)
year="${date:24:29}"
if [[ sys.os.mac ]]; then
year="${date:24:30}"
else
year="${date:24:29}"
fi

if [[ "$year" =~ ^[0-9]*00$ ]]; then
if [ "$((year % 400))" -eq 0 ]; then
Expand Down

0 comments on commit 035489d

Please sign in to comment.