-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add {domain.now}, supporting |crmDate #21531
Conversation
(Standard links)
|
45745a8
to
e06027f
Compare
There was a problem where I've added a bit here so that the same regex is always used by Also, rebased/force-pushed |
@totten are you happy with this now, pending a PR template re-write & some thoughts about docs? |
This is a new/recent assertion. Not passing. Looks different from other/similar assertions.
ece74b6
to
44dd64f
Compare
@eileenmcnaughton I've added several more tests, changed the notation to match Smarty (ie string-parameters are in quotes), and fixed the handling of There are some limitations with string-parameters - e.g. it will not accept a quote-mark or curly-brace inside of a quoted string. But I don't think this is problematic with our target use-cases. Date expressions that involve month/day names are sort of localized - ie if you have If you're happy with the updates, then I am too. |
Thanks @totten this looks good to me - it's actually quite exciting to think that we will have a non-hacky way to consolidate the various date handling (e.g I can update event badge tokens to use the token processor now it can support their preferred processing). @seamuslee001 @colemanw @demeritcowboy can one of you MOP this |
I also added a note to the update docs https://lab.civicrm.org/-/ide/project/documentation/docs/sysadmin/tree/case/-/docs/upgrade/version-specific.md/ |
Code, docs & tests all look good. |
Overview
Add new
{domain.now}
token - this provides the current date.It also supports formatting and provides a mechanism for other dates to follow - ie the following work based on the formats configured in the date settings page.
Before
^^ not available
After
and now it is
Technical Details
This expands the range of what is considered a valid token-filter. The filters may now accept string-parameters, as in
|crmDate:"first":"second":"third"
.crmDate
works if the token-value is defined as a\DateTime
object (which I will do on the main entities as a follow up)https://lab.civicrm.org/documentation/docs/user-en/-/merge_requests/498