Project

General

Profile

Actions

Defect #29855

closed

add_working_days may return wrong date when the start date is a non-working day

Added by Yutaka Hara about 8 years ago. Updated 13 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Issues
Target version:
Resolution:
Fixed
Affected version:

Description

Redmine::Util::DateCalculation#add_working_days(date, n) returns wrong date when date is holiday and n is a multiple of 5.

Example:

irb(main):004:0> Setting.non_working_week_days
=> ["6", "7"]
irb(main):001:0> include Redmine::Utils::DateCalculation
irb(main):002:0> add_working_days(Date.new(2018, 10, 27), 5)
=> Mon, 05 Nov 2018   # Expected Fri, 02 Nov 2018
irb(main):003:0> add_working_days(Date.new(2018, 10, 28), 5)
=> Mon, 05 Nov 2018   # Expected Fri, 02 Nov 2018

Tested with trunk@17598


Files


Related issues

Related to Redmine - Defect #14846: Calculation of the start date of following issues ignores the "non-working days" settingClosedGo MAEDAActions
Actions

Also available in: Atom PDF