Date offsets

Date offsets in Senta by IRIS are used to calculate a date based off another date. These are most commonly used to calculate the start and/or due date of a task. The date will be calculated relative to the job date.

Quick tip: you can test out any date offsets using the date offset workbench. Just add /s/d/t to your site url, e.g. example.senta.co/s/d/t

Basic date offsets

Basic date offsets are structured like so:

+1d = 1 day after the job date

+2w = 2 weeks after the job date

+3m = 3 months after the job date

-2d = 2 days before the job date

-1w = 1 week before the job date

-4m = 4 months before the job date

Business day offsets

Business day calculations mean you can skip weekends and bank holidays (currently UK bank holidays only) when entering date offsets.

+3b = 3 business days after the job date

- 4b = 4 business days before the job date

You can also put +0b or -0b on the end of a date offset to easily make sure it's a working day:

+0b means "the next business day"

-0b means "the previous business day".

For example, +30d+0b would mean thirty days after the job date, but if it were a weekend, then actually make it the following Monday.  Likewise, +30d-0b would mean thirty days after the job date, but if it were a weekend, then actually make it the previous Friday.

Compound date offsets

You can string date offsets together:     

+2w+3d = 2 weeks and 3 days after the job date

-3m+1d = 3 months, less 1 day, before the job date

+3m+2w+1d = 3 months, 2 weeks and 1 day after the job date

Fixed date offsets

For more complex scenarios, fixed date offsets are useful. Some date offsets are variable, for example "3 months after the job date".  But some are fixed, such as "the end of the last year" or "the end of the next tax year".  You can define these with special codes:     

n = the end of the week (Friday)    

e = the end of the month    

z = the end of the year

You use these much like other codes:

+1n = the end (Friday) of the current week    

+2n = the end (Friday) of the next week    

+1e = the end of the current month    

+2e = the end of next month    

+1z = the end of the current year    

+2z = the end of the next year

You can also work backwards to previous periods too:     

+0n = the end of the previous week (Friday)

+0e = the end of the previous month    

+0z = the end of the previous year

One important thing to note.  If the job date is the last day of the month, then +1e won't do anything as it will leave you at the end of the current month.  This is to ensure that the offsets work in a consistent way for any date.  Likewise, if the date is 31/12, then +1z will leave you on 31/12 i.e. it will take you to the end of the current year. 

Combining date offsets

You can use a combination of the date offsets listed above to make Senta find specific dates in the calendar. For example:

+0e+2d+3n-1d = the third Thursday of the month    

Breaking this down:

+0e = the last day of the month    

+2d = goes forward two days, so this is now the second day of the next month    

+3n = goes forward 3 Fridays    

-1d = goes back one day, to the third Thursday of the month     

Other useful combinations:

-5d-3m+1z+3m+5d = the end of the UK tax year, 5th April (for any given date)  

+1e-6d+1n = the last Friday of the month    

+1e-5d+1n-1d = the last Thursday of the month     

+1e-0b-1n+10d = the last Monday of the month    

+0e+5d+3n-4d = the third Monday of the month

Use date offsets with field references

Date offsets can also be calculated against date field references. If you have stored a date in a key date, as a task completion date or in a form field, you can add a date offset to this.

For example, the field reference for the Tax return filing date is taxreturnfilingdate.

This can be used to set the task start and due date offsets.

The task will start 1 month to the previous business day before the Tax return filing date. The task will be due on the Tax return filing date.

If you would like to pull a date from a form field into a date offset on a task or a key date, you should include the correct prefix. If the field has been filled in as part of that job, use job. and if the field exists on the client record, use client.

For example:

job.inforeceived+1w = 1 week after the information received date, captured on a form in the job

client.dateofincorporation+1m = 1 month after the Date of incorporation, captured when setting up the client record