First Last Prev Next    No search results available
Details
: Extend dates variables with offset parameter (+ / - n days)
Bug#: 26307
: smarttemplate4
: General
Status: REOPENED
Resolution:
: PC
: All
: unspecified
: P2
: enhancement
: ---

:
:
:
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Mirko Melone <mirko.melone@chello.at>
Assigned To: Axel Grude <axel.grude@gmail.com>

Attachments
1.5 prerelease 53 (389.79 KB, application/x-xpinstall)
2017-08-21 11:40, Axel Grude
no flags Details
1.5 prerelease 55 (389.79 KB, application/x-xpinstall)
2017-08-21 15:27, Axel Grude
no flags Details
1.6 prerelease 86 (477.66 KB, application/x-xpinstall)
2018-07-04 11:36, Axel Grude
no flags Details
Stationery / HTML Template (2.06 KB, text/html)
2018-07-04 11:43, Axel Grude
no flags Details


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2016-11-30 04:25
It is suggested to introduce a new variable to add future dates in new (and
reply and forwarded if possible) e-mails for, e.g., setting deadlines. The
future date could be calculated from the date the e-mail is sent possibly by
adding a number for the days until deadline. For example: %datelocal(14)% would
create a deadline 2 weeks after the sending date.
------- Comment #1 From Axel Grude 2017-08-21 05:10:58 -------
I was thinking about whether a date switch modification function could be used
to do arithmetics on any date field - even the "atomic" ones, such as from this
[terribly long, inherited from the original Addon] list:

%A% = Day of Week (Friday)
%a% = Day of Week (Fri.)
%B% = Month (January)
%b% = Month (Jan.)
%d% = Day of Month (01 to 31) - with leading zero
%e% = Day of Month (1 to 31)
%m% = Month (01 to 12) - with leading zero
%n% = Month (1 to 12)
%Y% = Year (1970)
%M% = Minute (00 to 59)
%S% = Second (00 to 59)
%H% = Hour, 24-Hour Format (00 to 23) - with leading zero
%k% = Hour, 24-Hour Format (0 to 23)
%I% = Hour, 12-Hour Format (01 to 12) - with leading zero
%l% = Hour, 12-Hour Format (1 to 12)

We already have a "global modifier" for times, which is 
%X:=sent%
(which switches the date from current local time to the date of when the
replied-to email is sent)

We could have something like
%X:=calculated(+2)% or similar which could act as a global switch for adding 2
days to any date field displayed in the template?
------- Comment #2 From Axel Grude 2017-08-21 11:39:51 -------
Here is a test template - note that the statement
%X:=calculated(0)% 
should be used to reset the numeral day offset, otherwise it will be repeated
on every date variable

<p>Hello %from(firstname)%,</p>
<h2>Test for Deadline</h2>
<h3>Current date</h3>
<p>
%X:=today% %X:=calculated(1)% it will expire on  %dateshort%  (today+1)   [
%e%.%n%.%Y% ] <br>
%X:=today% %X:=calculated(0)% This Email was created on %dateshort% (today)  [
%e%.%n%.%Y% ]<br>
</p>
<h3>Sent date</h3>
<p>You have 1 week from your Send Date, until<br> 
%X:=sent% %X:=calculated(7)% %dateshort%  [ %e%.%n%.%Y% ] <br> 
%X:=sent% %X:=calculated(0)% Sent on: %dateshort% <br> 
</p>
------- Comment #3 From Axel Grude 2017-08-21 11:40:57 -------
Created an attachment (id=8311) [details]
1.5 prerelease 26
------- Comment #4 From Axel Grude 2017-08-21 11:43:34 -------
(From update of attachment 8311 [details])

Adds the feature for adding / subtracting day arithmetics. Syntax:

%X:=calculated(n)%


n = number of days, e.g.

n = 7 for adding a week. will modify all following date variables to result in
the calculated date.
------- Comment #5 From Axel Grude 2017-08-21 15:27:31 -------
Created an attachment (id=8312) [details]
1.5 prerelease 55

In this version the X:=calculated variable can also work on New Emails (and not
just Reply / Forward)
------- Comment #6 From Axel Grude 2017-10-15 12:51:18 -------
(In reply to comment #5)
> Created an attachment (id=8312) [details] [details]
> 1.5 prerelease 55
> 
> In this version the X:=calculated variable can also work on New Emails (and not
> just Reply / Forward)
> 

An "hours" offset was suggested for having deadlines. Ti could be added as
second parameter, such as


%X:=calculated(n,x)%

where 
x = h:m

h = offset in hours
m = offset in minutes

for example:

%X:=calculated(7,6:30)%

this would add 7 days and 6 hours 30 minutes to the time.
------- Comment #7 From Axel Grude 2018-04-27 04:33:29 -------
Setting to Resolved Fixed with official Release 1.5
------- Comment #8 From Axel Grude 2018-04-27 04:34:50 -------
Reopening for adding the time offset parameters in the next version
------- Comment #9 From Axel Grude 2018-07-04 11:36:41 -------
Created an attachment (id=8497) [details]
1.6 prerelease 86

Added second parameter

MM:SS

To add an offset of 2 days, 5 hours and 30 minutes

%X:=calculated(2,5:30)%

To reset for the rest of the Email simply add

%X:=calculated(0)%

This can be combined with the usual switches 
%X:=sent%
%X:=today%
------- Comment #10 From Axel Grude 2018-07-04 11:43:48 -------
Created an attachment (id=8498) [details]
Stationery / HTML Template

This is a template Email for testing the date variables behavior.

You can either paste the source code into a HTML view (use ThunderHTMLEdit for
this) or add it as a Stationery Template.

First Last Prev Next    No search results available