XF 2.3 Any way to change dates?

My site is an RP one set in the Age of Sail with fictitious months and set in the 1700s. Is there a way to modify XF's dates so it could read like [custom month], 1743 for example?
 
This is something that's going to take custom development. You'd probably need to find out where <xf:date gets it's date/time info from, and alter that somehow to change all the months to something custom and to set the year to year-350, or something like that. There's probably some javascript that would need to be changed too. No telling where else other changes may need to be made to get this to work site-wide.

I'd say it's definitely something that's doable, but you'll need a custom developer.
 
Can you really have database dates pointing to pre-1970s (start of unix time)?
No because that's when 0 starts.

Best thing I can think of is doing math on a template to subtract 325 from the year so all posts begin in 1700 with 2026 as 1701.

Could be possible, but in bed to see if you can break apart the time format for Month and Day then do math on the year. Quite a lot of templates to do it on, unless macros handle most of them now.

Something to tinker with in the morning as it is an interesting concept (like those Facebook groups, "We pretend it's the 18/1900s).
 
I was playing with templates, and there are just way too many instances of calling the dates.

It'd probably be easier to extend Templater.php to subtract from the UNIX timestamps (or modify the dates some other way from there) and render the dates everywhere.

I would say custom development for this.
 
Yeah, that's what I was saying. They'll have to find where <xf:date /> gets its data from, and alter it there. If there are places in the templates that insert dates using something other than <xf:date /> I haven't seen it yet, but I'm far from being an expert. Heck, I'd still call myself an extreme novice. Anyways, at least in my mind, that would probably be the easiest way to change it. If you had something like <xf:date time="{$lastMonth}" />, instead of returning "Feb 27, 2025", it would return "Joh 27, 1701", or whatever.

Will definitely take someone who knows a bit about how the dates work in XF, or someone who is willing to dig into it and try to figure it out. But, like I said before, I'd imagine there is some javascript that might need to be edited too. Don't some of the dates come from there, or is that only the recent dates, like "Yesterday", "A moment ago", etc? 🤷‍♂️
 
Will definitely take someone who knows a bit about how the dates work in XF, or someone who is willing to dig into it and try to figure it out. But, like I said before, I'd imagine there is some javascript that might need to be edited too. Don't some of the dates come from there, or is that only the recent dates, like "Yesterday", "A moment ago", etc? 🤷‍♂️
I was going to try to do it with Templater.php in my free time, but I had SEO concerns about the output code for 325 years.
HTML:
<time class="node-extra-date u-dt" dir="auto" datetime="2025-03-25T12:10:00+0000" data-timestamp="1742904600" data-date="Mar 25, 2025" data-time="12:10 PM" data-short="2d" title="Mar 25, 2025 at 12:10 PM">Tuesday at 12:10 PM</time>
This shows the data and timestamp in arguments.

You could easily change it to:
HTML:
<time class="node-extra-date u-dt" dir="auto" datetime="2025-03-25T12:10:00+0000" data-timestamp="1742904600" data-date="Mar 25, 2025" data-time="12:10 PM" data-short="2d" title="Mar 25, 2025 at 12:10 PM">March 25, 1700</time>
...which was my first approach...

So that the hover still shows it was posted on March 25.

But, which one does Google read for the date? Would it dismiss it/penalize you if you edited the datetime, data-timestamp, and data-date?

Like:
HTML:
<time class="node-extra-date u-dt" dir="auto" datetime="1700-03-25T12:10:00+0000" data-timestamp="-10090942650" data-date="Mar 25, 1700" data-time="12:10 PM" data-short="2d" title="Mar 25, 1700 at 12:10 PM">March 27, 170</time>
 
I was going to try to do it with Templater.php in my free time, but I had SEO concerns about the output code for 325 years.
HTML:
<time class="node-extra-date u-dt" dir="auto" datetime="2025-03-25T12:10:00+0000" data-timestamp="1742904600" data-date="Mar 25, 2025" data-time="12:10 PM" data-short="2d" title="Mar 25, 2025 at 12:10 PM">Tuesday at 12:10 PM</time>
This shows the data and timestamp in arguments.

You could easily change it to:
HTML:
<time class="node-extra-date u-dt" dir="auto" datetime="2025-03-25T12:10:00+0000" data-timestamp="1742904600" data-date="Mar 25, 2025" data-time="12:10 PM" data-short="2d" title="Mar 25, 2025 at 12:10 PM">March 25, 1700</time>
...which was my first approach...

So that the hover still shows it was posted on March 25.

But, which one does Google read for the date? Would it dismiss it/penalize you if you edited the datetime, data-timestamp, and data-date?

Like:
HTML:
<time class="node-extra-date u-dt" dir="auto" datetime="1700-03-25T12:10:00+0000" data-timestamp="-10090942650" data-date="Mar 25, 1700" data-time="12:10 PM" data-short="2d" title="Mar 25, 1700 at 12:10 PM">March 27, 170</time>

I'm not sure about SEO penalties for doing something like this. If it were me, and I really wanted to do it, I'd change the title="" section, too, but leave everything else as-is. Or, are there other sites doing this? I might look at their HTML and see what they're doing. Does it seem to affect them in the search engines? If so, is it even something worth doing? If not, let's get to it!

Of course, as I said, I'm no expert at any of this. Everything I do is basically trial and error...sometimes a lot of error. 🤣 If it were me, and this is something that the members wanted, I'd do it, if I could and just see what happens.
 
Back
Top Bottom