I’m brand new to LWC and I came across this issue while designing a new widget.
I have a multi-day event that crosses from Dec 2026 into Jan 2027, and the values from {date} and {range} all seem fine.
But once I start using field tags to format the dates I get the wrong year for the end date:
Welcome to developing for LWC! Would you mind sharing the <field syntax you’re trying into a reply here? Then we can take a peek and see if we might have suggestions or insights into how that’s parsing those dates.
Thanks Andrew – here’s what I suspect is happening. Behind the scenes when you use date_format on an XPHP (or Field) variable, LiveWhale converts the existing variable string to a timestamp (strtotime) and then reformats it using the specified format.
I bet one of two things is happening:
It looks like end_date is just showing “January 3” with no year
Or it could be there’s something in the end_date (maybe it’s some HTML or something about the “until” markup across years) that is confusing that strtotime function behind the scenes.
In either situation, at least as a stopgap, you could try editing the general date format of the widget settings to something more generic (i.e MM-DD-YYYY) and see if that helps date_format=“” get past the confusion. Hope this helps!