Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added logic for days per week and day per year leave scenerio#1720

Merged
apoorv1316 merged 7 commits intodevelopfrom
leave-balance-issue-days-per-week
Mar 20, 2024
Merged

Added logic for days per week and day per year leave scenerio#1720
apoorv1316 merged 7 commits intodevelopfrom
leave-balance-issue-days-per-week

Conversation

@SiddharthShringi
Copy link
Contributor

No description provided.

@SiddharthShringi SiddharthShringi force-pushed the leave-balance-issue-days-per-week branch from c9146fc to f22db20 Compare March 19, 2024 10:40
@SiddharthShringi SiddharthShringi marked this pull request as ready for review March 19, 2024 10:42
Comment on lines 175 to 177
current_date = DateTime.now
current_year = current_date.year
current_month = current_date.month
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Define this on top & reuse the same in each method

def quarter_position_and_after_mid_quarter(date)
case date.month
when 1..3
quarter = 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quarter = (date.month / 3.0).ceil

case date.month
when 1..3
quarter = 1
mid_date = Date.new(date.year, 1, 1) + 1.month + 15.days # January 15th
Copy link
Collaborator

@nisusam nisusam Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mid_date = Date.new(date.year, (((quarter - 1) * 3) + 2, 1) + 15.days

@apoorv1316 apoorv1316 merged commit f731246 into develop Mar 20, 2024
@apoorv1316 apoorv1316 deleted the leave-balance-issue-days-per-week branch March 20, 2024 13:59
vipulnsward pushed a commit that referenced this pull request Feb 15, 2026
* Added logic for days per week and day per year leave scenerio

* Added days per quarter logic

* Added tests for different leave type cases

* Added specs when joining date is current year

* Added specs for different scenario  when joining date is current year

* Removed comments

* Fixed review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants