News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Relative Time Formats

Started by Pipke, June 04, 2019, 03:56:26 PM

Previous topic - Next topic

Pipke

Link to the mod

Relative Time Formats

For SMF 2.1.x
Tested only with the SMF default theme!

With this mod can the admin decide how to set the default display of time and date format with a relative one, such as 1 minute ago, 4 hours ago or Sunday at 10:20 etc.
Individual members can always override these defaults in the "Look and Layout" section of their profile settings

License
 * This SMF modification is subject to the BSD 2-Clause License

Admin settings
- Admin->Features and Options->General

User settings
- Profile->Look and Layout

Languages
- English

Changelog
Version 1.2.2 - Dec 7, 2023
- Fixed logical operators for output timeformat

Version 1.2.1 - Feb 22, 2022
- Fixed post linking calender and previews

Version 1.2 - Feb 16, 2022
- Fixed that this mod does not break the calendar page

Version 1.0.1 - Jul 19, 2021
- Updated installation package to handle more RC releases without emulation

Version 1.0 - May 30, 2019
- Initial Release
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

-Rock Lee-

Very good and I leave the translation to Latin Spanish 8)


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

Wellwisher

This is going to be a huge mod for theme devs. I have been looking for this for 2.0. Nice work.

Shades.

I have this latest version installed on 2.1.1...

Getting this error:

Error
Type of error
General
Error message
2: preg_replace(): Compilation failed: range out of order in character class at offset 521
File
/home2/*****/public_html/*****/Sources/RelativeTimeFormats.php
Line
177
URL of page causing the error
https://*****.com/index.php?action=admin;area=downloads;sa=logs;cc63d4c0=67056017d3553d5efdf36fc98d4ce724

Backtrace information
#0: smf_error_handler()
Called from unknown on line -1
#1: preg_replace()
Called from /home2/*****/public_html/*****/Sources/RelativeTimeFormats.php on line 177
#2: rtf_integrate_buffer()
Called from unknown on line -1

The only thing I changed after installing was...
Display time and date format as: (To) Relative based on 'Month Day, Year HH:MM am/pm'
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Shades.

Also just noticed that with this mod installed the popup dates in the calendar do not work. Like when adding an event in the calendar you click on the date and it usually pops up with a mini calendar to choose the date but it don't work with this installed.

Just to check, I uninstalled it and the calendar dates worked fine then I reinstalled it and the calendar date stopped working.
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Pipke

Quote from: Shades. on February 15, 2022, 07:18:31 PMI have this latest version installed on 2.1.1...

Getting this error:

Error
Type of error
General
Error message
2: preg_replace(): Compilation failed: range out of order in character class at offset 521
File
/home2/*****/public_html/*****/Sources/RelativeTimeFormats.php
Line
177
URL of page causing the error
https://*****.com/index.php?action=admin;area=downloads;sa=logs;cc63d4c0=67056017d3553d5efdf36fc98d4ce724

Backtrace information
#0: smf_error_handler()
Called from unknown on line -1
#1: preg_replace()
Called from /home2/*****/public_html/*****/Sources/RelativeTimeFormats.php on line 177
#2: rtf_integrate_buffer()
Called from unknown on line -1

The only thing I changed after installing was...
Display time and date format as: (To) Relative based on 'Month Day, Year HH:MM am/pm'

sorry i have tested mod and i get no errors? Maybe you can point out on wich page this error happens...

Quote from: Shades. on February 15, 2022, 08:25:27 PMAlso just noticed that with this mod installed the popup dates in the calendar do not work. Like when adding an event in the calendar you click on the date and it usually pops up with a mini calendar to choose the date but it don't work with this installed.

Just to check, I uninstalled it and the calendar dates worked fine then I reinstalled it and the calendar date stopped working.

thx for the report and yeah the popup don't comes up, i need to fix that, also i don't get any event posted always getting -> An error has occurred Invalid date, this is without mod installed ;( weird.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Pipke

Mod updated to v1.2

Changelog
Version 1.2 - Feb 16, 2022
- Fixed that this mod does not break the calendar page
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Shades.

Quote from: Pipke on February 16, 2022, 02:10:33 PMsorry i have tested mod and i get no errors? Maybe you can point out on wich page this error happens
According to the error log I posted it looks like https://*****.com/index.php?action=admin;area=downloads so it may be just this mod and the download mod butting heads. I'll see if it happens again...not a big deal. The bigger deal for me was the calendar popup so I'll try your update and post back thanks! 8)


Edit: Updated mods works good thank you! ;)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Shades.

Quote from: Pipke on February 16, 2022, 02:57:13 PMMod updated to v1.2

Changelog
Version 1.2 - Feb 16, 2022
- Fixed that this mod does not break the calendar page
Ok this is weird cause it doesn't break the calendar date popup when creating a "NEW" event but does break it when Linking a "Posted" event to the calendar. Again I checked by uninstalling this mod and the popup calendar date works but stops working after I reinstalled this.
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Pipke

Quote from: Shades. on February 21, 2022, 10:32:30 PM
Quote from: Pipke on February 16, 2022, 02:57:13 PMMod updated to v1.2

Changelog
Version 1.2 - Feb 16, 2022
- Fixed that this mod does not break the calendar page
Ok this is weird cause it doesn't break the calendar date popup when creating a "NEW" event but does break it when Linking a "Posted" event to the calendar. Again I checked by uninstalling this mod and the popup calendar date works but stops working after I reinstalled this.

thx for the report agian, it's fixed in new release ;)
Version 1.2.1 - Feb 22, 2022
- Fixed post linking calender and previews
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Shades.

ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Shades.

Found another issue. With this mod installed for some reason it enlarges my forum text in certain areas. Noticably in package manage. Image 1 is without mod and image 2 is with mod and image 3 with mod shows the page "admin" (or whatever page I'm on) in top left corner of every page.
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Pipke

Quote from: Shades. on February 23, 2022, 07:54:00 PMFound another issue. With this mod installed for some reason it enlarges my forum text in certain areas. Noticably in package manage. Image 1 is without mod and image 2 is with mod and image 3 with mod shows the page "admin" (or whatever page I'm on) in top left corner of every page.

i already fixed that
uninstall/remove the 1.2.1 version you got now installed. And download the version 1.2.1 agian on the mod site and install that one.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Shades.

Ok thanks it works great now! 8)

I was pretty sure that I had downloaded and uploaded the latest copy but I guess I didn't lol! :P
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Pipke

Quote from: Shades. on February 24, 2022, 05:48:02 AMOk thanks it works great now! 8)

I was pretty sure that I had downloaded and uploaded the latest copy but I guess I didn't lol! :P

i uploaded version 1.2.1 with that bug you experienced, in the mean time you downloaded it, before i fixed and uploaded the right version 1.2.1 agian. Hope i explained well ;)
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Shades.

Quote from: Pipke on February 24, 2022, 05:56:14 AM
Quote from: Shades. on February 24, 2022, 05:48:02 AMOk thanks it works great now! 8)

I was pretty sure that I had downloaded and uploaded the latest copy but I guess I didn't lol! :P

i uploaded version 1.2.1 with that bug you experienced, in the mean time you downloaded it, before i fixed and uploaded the right version 1.2.1 agian. Hope i explained well ;)
Oh ok I see! Thanks! 8)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Shades.

My date & time are showing up like this: data-rtf-time="2022-03-01 19:24:52" :o
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Pipke

Quote from: Shades. on March 02, 2022, 06:46:17 AMMy date & time are showing up like this: data-rtf-time="2022-03-01 19:24:52" :o

all over the website, or just some/one page?
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Shades.

Actually it's only on every mod that I have installed that has a date displayed but not on SMF itself. So I'll just have to do without this mod for now. :(
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Pipke

Quote from: Shades. on March 02, 2022, 03:46:13 PMActually it's only on every mod that I have installed that has a date displayed but not on SMF itself. So I'll just have to do without this mod for now. :(

can you provide me a link to an page where this matter happens.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Advertisement: