Hello there,
I am trying to create some relative date functions with the Dynamic Content API, but I’m honestly not sure where to start. I’m familiar with custom functions, can make my way around PHP, and have coded up some pretty awesome custom provider hooks, but I’m wanting to create dynamic content that lets me pass a strtotime()
string into PHP and then turn it back into a date()
format of my choosing.
For instance, I have the following PHP I’d like to replicate with dynamic content:
$thisWeekDate = strtotime("Monday this week");
$thisWeekStr = date("Y-m-d",$thisWeekDate);
I’d like to essentially be able to return this data by inputting the following dynamic content {{dc:date string="Monday this week" format="Y-m-D"}}
.
Does that make sense and is that possible using the Dynamic Content API?