Resource icon

User Date/Time Format Settings 1.0.3

No permission to download

CmptrWz

Member
CmptrWz submitted a new resource:

User Date/Time Format Settings - Allow users to choose individual Date and Time Formats

My first addon, targeted at my own annoyance for being dependent on the Language options for date and time formats.

Allows users to override the language-level date and time format settings.

Adds two new User Custom Fields:
  1. Preferred Date Format
    • All (non-custom) formats from the admin panel
    • Full-year m/d/y and d/m/y formats
    • ISO 8601 YYYY-MM-DD format
  2. Preferred Time Format
    • 12 and 24 hour formats
They are both optional and...

Read more about this resource...
 

CmptrWz

Member
Please do you have any screenshot or preview for this addon?
I added screenshots of the dropdowns to the resource description. Everything else is just "all date/time output follows the selected format(s) instead of the language's settings".
 

Alan_SP

Active member
I added custom lines, to

setup.php
Code:
            $userDate->field_choices = [
                'day_full_date' => 'Tuesday - 29.09.2020',

...

            $userTime->field_choices = [
                '12h' => '7:30 PM',
                '24h' => '19:30',
                '24h_with_seconds' => '19:30:21'
            ];

Language.php

Code:
    private $cw_date_formats = [
        'day_full_date' => 'l - d.m.Y',
        
...
        
    private $cw_time_formats = [
        '12h' => 'g:i A',
        '24h' => 'H:i',
        '24h_with_seconds' => 'H:i:s'
    ];

Well, before installing I had warning to review warnings and when I confirmed to continue, everything seems OK. Is it fine to add new lines like this or should I did something differently?
 

CmptrWz

Member
I imagine that the warnings were due to the hash mismatches on the addon files compared to the hashes.json file, otherwise that should be fine.
 

CmptrWz

Member
@Alan_SP BTW, if all you're looking for is having that date and time format, you could just put those into your language config as the defaults and not need an addon at all. Or leave the addon for people who want to choose otherwise.
 

Alan_SP

Active member
I imagine that the warnings were due to the hash mismatches on the addon files compared to the hashes.json file, otherwise that should be fine.
Yes, I have got even file check tampering warnings now on server. How to get my version to have hashes? I'll include my version, if you could help me with this.

Is there an easy way for me to create correct hashes, so I can do this myself?

Or, there should be an easy way to edit time formats to customize it to our liking.

I hope this could be solved, that I don't get this file check warnings.
 

Attachments

  • CmptrWz-UserDateTime-1.0.0_b.zip
    17.3 KB · Views: 0

Alan_SP

Active member
Thanks, sorted it out with help of this thread. Now I have version with everything correct, from file hashes point of view. And addon works.

It would be very useful if you find way that we can manually changed time stamps to suite our needs.
 

gogo

Well-known member
This add-on crashes (again) the forum after XF2.2.1 is installed. Had to disable the listener and uninstall this add-on.

The bad thing is.. the following options are still there in users' references.

1602744468844.png
 

CmptrWz

Member
This add-on crashes (again) the forum after XF2.2.1 is installed. Had to disable the listener and uninstall this add-on.
Which version of the addon are you using? The latest version seems to work fine on 2.2.1 for me right now.

As for the custom user fields, those can be disabled/removed from the Users -> Custom User Fields admin page.
 

gogo

Well-known member
Yes i reported this problem with another add-on last week I guess. And you fixed it shortly.

But today after installing the latest XF2.2.1, it crashed again. I needed to repeat everything I did last time to have my forum back.

Maybe I can install your add-on now and see what happens.
 

gogo

Well-known member
Just tried reinstalling the addon. Seems no problem. And uninstalled it. The above options in account preferences are still there.

So a complete uninstallation is not possible for this addon?

Using 1.0.1
 

CmptrWz

Member
The Custom User Fields can be deleted at any time with the admincp, even while the addon is installed (if, say, you don't want people changing the date format but are happy with them changing the time format).
 
Top