Project

General

Profile

Actions

Defect #29855

open

add_working_days returns wrong date

Added by Yutaka Hara about 6 years ago. Updated almost 6 years ago.

Status:
Confirmed
Priority:
Normal
Assignee:
Category:
Issues
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
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

fix-29855.patch (1.64 KB) fix-29855.patch Mizuki ISHIKAWA, 2018-11-07 07:48

Related issues

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

Actions
Actions

Also available in: Atom PDF