View Issue Details

IDProjectCategoryView StatusLast Update
0007634mantisbtcustom fieldspublic2019-08-08 16:13
Reportermbogosian Assigned Tovboctor  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version1.0.6 
Fixed in Version1.2.0a1 
Summary0007634: Support relative default for Date Custom Fields (e.g. {tomorrow}, {+2 days}, {next week})
Description

When applying filters to or defining defaults for fields of type "Date", relative dates should be allowed. For example:

[Today]
n (days|weeks) from [Today]
n (days|weeks) before [Today]

Let's say one added a "Due" custom field. One could create a filter that showed all issues that needed to be resolved in the next two weeks with the following constraint:

"Due" on or before 2 weeks from [Today]

One could set the default value of "Due" to be:

5 days from [Today]

So that whenever a new issue was filed, that field for that bug would populated with today's date plus 5 days (at the time of its creation).

I think this adds much-needed flexibility to the "Date" type field.

TagsNo tags attached.

Relationships

has duplicate 0008481 closedatrol default value for date type fields (variable) 

Activities

vboctor

vboctor

2008-03-29 00:59

manager   ~0017488

Implemented by svn:5150
http://mantisbt.svn.sourceforge.net/mantisbt/?rev=5150&view=rev

The format used for defaulting is {xxxx} where xxxx is a relative date supported by PHP strtotime(), see below for more documentation:
http://www.gnu.org/software/tar/manual/html_node/tar_119.html#SEC119

Some samples:

  • {tomorrow}
  • {yesterday}
  • {+2 days}
  • {next week}
  • {last week}