humdek-unibe-ch / sh-shp-formula_parser

The plugin is based on (MathExecutor)[https://github.com/neonxp/MathExecutor]. It supports all the operators and functions that are supported in MathExecutor. The plugin uses (MathPHP)[https://github.com/markrogoyski/math-php] for additional math functions
0 stars 0 forks source link

Add functionality to alter dates #2

Closed NS21fpsy closed 8 months ago

NS21fpsy commented 8 months ago

I'm trying to define the end of a time range based on a dynamic starting date.

example for formula: https://dropit.psy.unibe.ch/admin/cms_update/97/update/prop

Maybe the formula parser can support something like strtotime() or date_add() ?

I'm trying formulas like:

date('Y-m-d', strtotime('{{first_entry_date_formatted}}'. ' + 7 days')) or date_add('{{first_entry_date_formatted}}', date_interval_create_from_date_string("7 days"))

but I can't generate the new date that I want.

Kodzhabashev commented 8 months ago

It is not possible right now. But this can be added.

Kodzhabashev commented 8 months ago

Implemented in v1.4.3