Welcome,
How Can We Help You?

Calculations with Dates

In LAWLIFT you can not only display a specific date in a format of your choice, but you can also calculate with dates.

 


 

 

For example, it is possible to add a defined period of time to an entered date or have it subtracted. Moreover, you can automatically insert the current date and you can also calculate with this variable.

Add a Calculation with Dates to your Template

Calculating with dates basically works the same way as normal calculations. The only difference is that you insert the calculation inside a placeholder where you want your date to appear. Enter the command:

::ph[calculate(...)]

Then connect the placeholder to your text field by clicking on it and then clicking in the text field.

Warning

Please be aware, that the connection between your placeholder and the text field gets lost, if you edit the calculation. Thus, you have to connect the placeholder to your text field again after an edit.
 


Here is a list of the possible calculations we offer:

  • calculate(add xx days/months/years)
  • calculate(add xx days/months/years endOfMonth/Year)
  • calculate(add xx days/months/years startOfMonth/Year)
  • calculate(subtract xx days/months/years)
  • calculate(subtract xx days/months/years endOfMonth/Year)
  • calculate(subtract xx days/months/years startOfMonth/Year)

Warning

Pay attention to upper and lower case.

 


The second calculation adds the entered time period to the end of the month or year to the date you choose within your question, the third one adds it to the start of the month or year.

Example: 

We want to add three years to the given date from the end of the year the date is in:
::ph[calculate(add 3 years endOfYear)]

Within your calculation you always have to enter the following three properties:

  1. An operation: "add", "subtract"
  2. A value as a fixed integer: e.g. "12"
  3. A unit: from year to the millisecond
  4. And optional a relative operation: "startOfUnit" or "endOfUnit", whereas your unit of choice replaces Unit

Formatting of the Date

To format your date you can enter specific commands within your placeholder. Here is an example:

After typing "::ph[format(DD.MM.YYYY)]" and connecting this placeholder with the text field "Date" the placeholder looks as follows:

Combine the Format with the Calculation

To combine your chosen format with the calculation you want to execute, just enter both in the command within your placeholder:

 

Today's Date as Default

If you want LAWLIFT to fill out your placeholder with today's date automatically, you just need to insert a new variable into your text field:

It will have a preselected today's date when generating a document. 

Tip

The user can still change the date later on!

 

Was this article helpful?

Can't find what you're looking for?

Our award-winning customer care team is here for you.

Contact Support