Hi, Is there a way to get the end of business hours for a day from a calend

Hi,
Is there a way to get the end of business hours for a day from a calendar?
For Example, If 9AM - 5PM is the business hours as per the calendar and a date is given as input, can we get the end of business hours for that particular day?

Thanks in advance

OriginalPostID-191582

OriginalPostID-191582

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    There's not a function that does exactly that as far as I know, but you can get close using the out-of-the-box functionality with something like the expression below. It's not particularly nice but it returns an array of 24 booleans that equate to the 0-23 hours of the given date, where the true/false value of each index indicates whether or not it's a working day. It would be possible to expand on this down to the minute with a little more work.

    apply(
    fn!calisworktime,
    apply(
    fn!datetime(
    year(
    ri!date
    ),
    month(
    ri!date
    ),
    day(
    ri!date
    ),
    _,
    0,
    0,
    0
    ),
    enumerate(
    24
    )
    )
    )
Reply
  • 0
    Certified Lead Developer
    There's not a function that does exactly that as far as I know, but you can get close using the out-of-the-box functionality with something like the expression below. It's not particularly nice but it returns an array of 24 booleans that equate to the 0-23 hours of the given date, where the true/false value of each index indicates whether or not it's a working day. It would be possible to expand on this down to the minute with a little more work.

    apply(
    fn!calisworktime,
    apply(
    fn!datetime(
    year(
    ri!date
    ),
    month(
    ri!date
    ),
    day(
    ri!date
    ),
    _,
    0,
    0,
    0
    ),
    enumerate(
    24
    )
    )
    )
Children
No Data