A template variable is set to input a date. Default date is set to today. Earliest date is set to 2026-02-20. Allow blank: No. Click save, then click to clear the cache. But on the resource, the client sees a default date of 1970-01-01, and the datepicker begins from January 1970.
Is there a setting somewhere to configure that default date and the datepicker so the datepicking process on the resource begins from today’s date?
Strangely, a Google search for “modx revolution date template variable datepicker configuration” shows nothing that seems to answer the question. The answer must be easy, but if you don’t know it…
Emptying the cache in the core folder on the server also does not fix the problem. We remain with an autopopulated 1970 date and the red error telling us that 1970 is prior to the earliest permitted date fixed in the TV input settings.
Thank you for the reply. I am using 3.1.2 on PHP 8.1.
I know where to find the settings for TinyMCE, for instance, and am wondering if there are some settings in a similar location for the datepicker.
It seems odd that the datepicker ignores the earliest date set when creating the TV and displays an error message before the client has entered a date.
My guess at the moment is that I need to remove the automated date functionality from the TV and set it to just accept a string like 21-02-2026 and then figure out a way to convert the string to time and sort the resources by that time.
I tried to reproduce the issue by using the same settings you detailed above ( “Default Date and Time” = Today (midnight), “Earliest Date” = 20.02.2026, “Allow blank” = No).
But when I create a new resource, I see the current date (21.02.2026) in the datepicker as the default value, as expected.
(On this installation, the system setting for “manager_date_format” has been changed to d.m.Y)
This datepicker is part of the date TV. There are no other settings available, than the ones shown in the TV settings.
“1970-01-01” is just the equivalent of a 0 value for a unix timestamp.
The question is, why MODX sets the value to 0 (on your system) and doesn’t use the default.
A thousand thanks, if not more. Went to the manager_date_format and changed it to d-m-Y (from Y-m-d), which seemed like a trivial alteration that could not possibly be the solution. Still, in the settings the default date of 1970 was showing:
Whether or not that is also part of the solution is just another grain of intellectual sand on the infinitely expansive beach-like existential mystery.
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.