Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
I use Date field with "Date and time" formatter.
For this formatter I can set "starting from" option to now ('now'), relative feature ('+1 day') or any date in format YYYY-MM-DDTHH:MM:SS.
That will be useful to set '-1 day', but as I can see, arg_parts()/arg_range()
don't support relative dates with '-' (like my 'P-1D').
If I set '-1 day' it is recognized as 'now'. Is it required restriction?
Comment | File | Size | Author |
---|---|---|---|
#3 | date-fix-1598832-3.patch | 1.05 KB | chaps2 |
| |||
#2 | 2012-05-24_22-32-55.jpg | 35.63 KB | kalabro |
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedI'm having trouble understanding, sorry. Can you try to clarify?
Comment #2
kalabroI'm so sorry. One more try:
I looked through the code and understood that for now it can't be done, so I created feature request.
Is that will be difficult to allow any
strtotime()
string for flexibility and then convert it to ISO format?Comment #2.0
kalabrotypo
Comment #3
chaps2 CreditAttribution: chaps2 commentedIssue is still present in 7.x-2.x. Patch attached which allows negative relative dates - e.g. "now -2 days".
Comment #4
DamienMcKennaThanks for the patch, we'll try to review it soon.
BTW when you upload a patch it helps to set the status to "needs review", that triggers the testbots and lets others know that there's something review.
Comment #5
DamienMcKennaI think we should add test coverage for this.