I am using the following code to get a work days in the future or past.

in.terminateEndDateTime = ivy.cal.getWorkDayIn(in.terminateStartDateTime, in.days);

When I use the API with negative days, the API does not return a date in the past, instead the given (or current) date is returned. Example:

IBusinessCalendar.getWorkDayIn(-10) // returns current date, without any calculation

Have anyone an idea? THX for the help.

asked 07.07.2015 at 15:15

Joachim's gravatar image

Joachim
16113
accept rate: 0%

edited 09.07.2015 at 15:32

Flavio%20Sadeghi's gravatar image

Flavio Sadeghi ♦♦
1.8k5723


Thanks for reporting.

I have just analysed and fixed the method IBusinessProcess.getWorkDayIn(...). See Issue

#25593: BusinessCalendar.getWorkDayIn(...) with a negative relative-work-day as parameter returns passed date

It works now as exected. The following examples shows its usage:

All days of the week are working days, except the Sunday is a day off.
------------------------------------
| FR | SA | SU (day off) | MO | TU |
------------------------------------
getWorkDayIn(SA, 0) -> SA
getWorkDayIn(SA, 1) -> MO
getWorkDayIn(SA, -1) -> FR (FIXED: before SA)

getWorkDayIn(SU, 0) -> MO
getWorkDayIn(SU, 1) -> TU (FIXED: before MO)
getWorkDayIn(SU, -1) -> SA (FIXED: before SU)

getWorkDayIn(MO, 0) -> MO
getWorkDayIn(MO, 1) -> DI
getWorkDayIn(MO, -1) -> SA (FIXED: before MO)

The fix will be included in the next Hotfix (5.1.6) by the end of next week. Available on our download page .

link

answered 09.07.2015 at 15:26

Flavio%20Sadeghi's gravatar image

Flavio Sadeghi ♦♦
1.8k5723
accept rate: 75%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1

Asked: 07.07.2015 at 15:15

Seen: 819 times

Last updated: 09.07.2015 at 15:32

Related questions