Post by lesliegrun » Wed Feb 21, 2018 2:10 am

Hello
i am using opencart 3.0.2 with an dutch language pack
and i want a date of birth field in the registration form so i added it in the custom field section of customer in the admin area
it seems to work fine but the date format is not correct for my country it is yyyy-mm-dd and i need it to be dd-mm-yyyy
i try to find it in the language pack admin and catalog folder but i cant find it
on everything else the date format is correct (costumer registration, order date) dd-mm-yyyy
can someone please help me to correct it
kind regards
Leslie (dutch,Nederlands)

Newbie

Posts

Joined
Tue Jan 23, 2018 4:13 am

Post by IP_CAM » Thu Feb 22, 2018 4:35 am

Well, in the default OC v.3.0.2.x Front + Admin Theme, the date is written like this:
data-date-format="YYYY-MM-DD"
And the most simple way to change this, in the very many files, where it exists,
would be, to mass search/replace this line on your Computer to:
data-date-format="DD-MM-YYYY"
and then, reupload the entire Front+back Theme Content again, if you are
not able to create a VqMod or OcMod, doing this 'globally'.
Just an idea, since I don't know, if this can possibly be changed somewhere
in the v.3.x Admin Section :D
Ernie
---
PS: This one seems to do it in OC-3, but possibly in the opposite way:
https://www.opencart.com/index.php?rout ... n_id=27267
---
All v.3.0.2.x Admin + Theme files, where it exists:
Image
---
Information to this found here:
https://www.opencart.com/index.php?rout ... n_id=26934

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by lesliegrun » Fri Feb 23, 2018 8:50 pm

I tried to change the codes but almost all were good dd-mm-yyy i tink it has to do something with the bootstrap-datetimepicker
but i cant find what I have to change
Image

Attachments

datepicker.png

datepicker.png (55.47 KiB) Viewed 2801 times


Newbie

Posts

Joined
Tue Jan 23, 2018 4:13 am

Post by Yasabe » Tue Nov 06, 2018 5:27 pm

Friends, I'm dealing with this problem since version 1.5.x. In the 2.x version, I tried and solved it, but in the 3.x version, it made it difficult to solve this problem. Unfortunately, this problem is never taken seriously in the forums and passed. Someone even asked, "Why do you want to change it?" Note: Sorry for Google Translate.

New member

Posts

Joined
Fri Nov 14, 2014 11:56 pm

Post by OSWorX » Tue Nov 06, 2018 6:35 pm

Don't know where the problem is??
Changing the format is a very easy task.
For example, you want the output like: 06.11.2018 (today) instead of the standard 2018-11-06

For OpenCart 3.0.2.0: goto
admin/view/template/customer/custom_field_form-twig
Look for

Code: Select all

data-date-format="YYYY-MM-DD"
And change it to your wanted output. e.g.:

Code: Select all

data-date-format="DD.MM.YYYY"
Do that in every file you want to have another display than the standard.

It would be much simplier if the format could be changed via the admin or use a variable in the language master file.

p.s.: Ernie was in the right way above.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 140 guests