Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add Business Hours Check Extension Method #212

Merged

Conversation

Rekha-Reddyshetty
Copy link
Contributor

@Rekha-Reddyshetty Rekha-Reddyshetty commented Nov 12, 2024

Description

This pull request implements a new extension method, IsWithinBusinessHours, for the DateTime class, as discussed in issue 184. The method helps determine if a specific DateTime falls within a given range of business hours. It accepts two TimeSpan parameters, startTime and endTime, and returns true if the given time is between them. If startTime is greater than endTime, the method handles the scenario of business hours spanning across midnight (e.g., from 9 PM to 5 AM).

Key Features:

  • Adds the IsWithinBusinessHours extension method to DateTime.
  • Supports business hours that span across midnight.
  • Returns true if the current DateTime is within the specified working hours, false otherwise.

Note: Feel free to share any feedback or suggestions.

@joaomatossilva joaomatossilva merged commit 81b8785 into joaomatossilva:master Nov 21, 2024
1 check passed
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.

2 participants