Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Added Support for getting qaurter of the year #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/ReDate_quarter.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let getQuarter = (date: Js.Date.t): int => {
let month = Js.Date.getMonth(date)
switch month {
| _ if month >= 0.0 && month <= 2.0 => 1
| _ if month >= 3.0 && month <= 5.0 => 2
| _ if month >= 6.0 && month <= 8.0 => 3
| _ => 4
}
}