cjohnsonuk
2 issues I've got stuck on :
Firstly :
I have two fields in my bureaucracy form that creates a new policy document from a form of mandatory information using a template with form placeholders:
date "EffectiveFrom" =%Y-%m-%d !
date "NextReview" =%Y-%m-%d !
Both of these invoke an error :
"EffectiveFrom" needs to be a valid date in the format yyyy-mm-dd.
...when I remove the ! from the end of the line even though the date entered in the text box in the form is in that format. I need to remove the ! so that the dates are completed.
Secondly :
I'd like the Next review date to be today +12 months (or 6 months or some other interval) but I can't see how to set the default value
In the template I have them as :
---- dataentry policy ----
...
Effective From : @@EffectiveFrom@@
Next Review : @@NextReview@@
...
----
So I could do the maths in the form (preferred) or in the template before the page is created
eg
Effective From : @@EffectiveFrom@@
Next Review : <date @@EffectiveFrom@@ +12M>
On a similar topic I also have this issue in the same template where I use the todo plugin and I want to set the start and due dates for the tasks that need to be carried out once the document has been created :
<todo @@@Author@@ start:@DATE@ due:@DATE@ > Create Success Criteria for @@PolicyName@@</todo>
where I want to set the due date a set time after the start date.
I've tried the date plugin but that seems to a) not work* and b) give a date that updates every time the page loads, I just want it to put a date in when the page is created.
Any clues appreciated
thanks
Chris
*{{date>%Y-%m-%d %H:%M|timestamp=strtotime("now")}}
{{date>%Y-%m-%d %H:%M|timestamp=strtotime("now +1 day")}}
results in
2016-04-29 15:27
2016-05-01 15:27
instead of
2016-04-29 15:27
2016-04-30 15:27