Extend syntax and allow to set relative due dates
codescape opened this issue · comments
Dates shall be set relative to the current date or relative to the date of the parent issue.
Tasks
- allow to specify a due date relative to
@now
plus/minus years/months/weeks/days - allow to specify a due date relative to
@inherit
date from parent plus/minus years/months/weeks/days - extend documentation
- test for dueDate and custom field
Examples
- due in 5 days
dueDate: @now+5d
- due in one month and 4 days
dueDate: @now+4d1m
- due one day before parent
dueDate: @inherit-1d
- due now
dueDate: @now
- due as parent
dueDate: @inherit
- due with spaces
dueDate: @now + 1y
Also allow for @now
and @inherit
without any calculations on it:
@Test
public void returnDateForRelativeDateNow() {
Timestamp timestamp = dateTimeStringService.dateStringToTimestamp("@now", null);
assertThat(timestamp.toString(), is(equalTo(todayAsString(0, 0, 0, 0))));
}
@Test
public void returnDateForRelativeDateInherit() {
Timestamp timestamp = dateTimeStringService.dateStringToTimestamp("@inherit", new Timestamp(new Date().getTime()));
assertThat(timestamp.toString(), is(equalTo(todayAsString(0, 0, 0, 0))));
}