Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date of article broken in persian language by update to 3.4.2 #7298

Closed
farhadst opened this issue Jul 1, 2015 · 39 comments
Closed

date of article broken in persian language by update to 3.4.2 #7298

farhadst opened this issue Jul 1, 2015 · 39 comments

Comments

@farhadst
Copy link

farhadst commented Jul 1, 2015

update joomla 3.4.1 to 3.4.2
when edit article, date is broken like #6207
actual problem in joomla 3.4 is back in 3.4.2
in old version after click on save article, jalali date convert to gregorian before submit form but in 3.4.2 date is not converted!
57264512-be72-11e4-8e11-2416745b0f43
@dgt41

@infograf768
Copy link
Member

Confirmed...

@dgrammatiko
Copy link
Contributor

Is there a JS error logged?

@infograf768
Copy link
Member

@dgt41
I suggest you test for yourself as there are many errors

@farhadst
Copy link
Author

farhadst commented Jul 1, 2015

@dgt41
It seems js file not loaded to be convert date
and when save article, get error in line 108 of mootools-core.js in firebug console!
please test yourself

@mamool
Copy link

mamool commented Jul 1, 2015

This error happened when update "core.js" in joomla 3.4.2

@infograf768
Copy link
Member

Jalali calendar js ARE loaded OK:

<script src="/trunkgitnew/media/fa-IR/js/calendar.js" type="text/javascript"></script>
  <script src="/trunkgitnew/media/fa-IR/js/calendar-setup.js" type="text/javascript"></script>

The issue looks indeed related to core.js and started with this commit
de492a6
( #6587 )

@Fedik
Copy link
Member

Fedik commented Jul 2, 2015

seems calendar-setup-uncompressed.js has wrong event binding,

work:

jQuery(document).ready(function() {
        jQuery(C.inputField.form).on('submit', function() {
            var dateEl = C.inputField || C.displayArea;
            var dateFmt = C.inputField ? C.ifFormat : C.daFormat;
            if (dateEl && parseInt(dateEl.value) != 0 && dateEl.value != '') {
                var date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt, 'jalali');
                C.inputField.value = date.print(C.ifFormat, 'gregorian', C.langNumbers);
            }
        });
});

not work:

jQuery(document).ready(function() {
        jQuery.fn.addEvent = jQuery.fn.bind;

        C.inputField.form.addEvent('onsubmit', function() {
            var dateEl = C.inputField || C.displayArea;
            var dateFmt = C.inputField ? C.ifFormat : C.daFormat;
            if (dateEl && parseInt(dateEl.value) != 0 && dateEl.value != '') {
                var date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt, 'jalali');
                C.inputField.value = date.print(C.ifFormat, 'gregorian', C.langNumbers);
            }
        });
});

but, I did not tested it well, as I do not know Persian and all aspects of this language, so cannot be sure for 100%

@farhadst
Copy link
Author

farhadst commented Jul 2, 2015

@Fedik
i did tested this code and not work

@Fedik
Copy link
Member

Fedik commented Jul 2, 2015

for test calendar-setup-uncompressed.js need to enable the Debug in global config, hope you did it? 😉

@infograf768
Copy link
Member

I tested it and it works here:
Exchange these files in media/fa-IR/js/ to use these.
https://www.dropbox.com/s/z4sq61515q8svyf/calendar-setup-uncompressed.js?dl=0
https://www.dropbox.com/s/wckglyo78qp7dot/calendar-setup.js?dl=0

One should know that when closing or saving the calendar field switches to gregorian for a second.

@farhadst
Copy link
Author

farhadst commented Jul 2, 2015

@Fedik you right, after enable debug its work :)
@infograf768 i have replace this files and its work
calendar after save converted fine
Thanks

@zero-24
Copy link
Member

zero-24 commented Jul 2, 2015

Thanks for the feedback I'm going to close here 😄

@zero-24 zero-24 closed this as completed Jul 2, 2015
@cyrezdev
Copy link
Contributor

cyrezdev commented Jul 2, 2015

@infograf768 Yes, with your fa-IR js it works.
As it is a language pack issue, maybe right to inform the translation team to release a 3.4.2 version of the Persian language with the correct js files ?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7298.

@Bakual
Copy link
Contributor

Bakual commented Jul 2, 2015

As it is a language pack issue, maybe right to inform the translation team to release a 3.4.2 version of the Persian language with the correct js files ?

Exactly

@dgrammatiko
Copy link
Contributor

Just to mention that this is a bad communication problem here, as we already stated that the language files should be updated with the correct code for 3.4.2 #6207 (comment)

@farhadst
Copy link
Author

farhadst commented Jul 2, 2015

@balvard
please replace correct code and release new persian language pack
and i have email correct code to persian language team

@infograf768
Copy link
Member

The TT coordination has sent a mail too to the fa-IR Coordinator.

@cyrezdev
Copy link
Contributor

cyrezdev commented Jul 2, 2015

Just a question : is there someone working on a new calendar datetime picker ?
In my opinion, Jalali calendar should be managed by Joomla core, not a language pack. (I know it's a hard work to manage, so that's why i wonder if someone already started to work on this ;-) )

@infograf768
Copy link
Member

Many people tried, without success until now.

@Fedik
Copy link
Member

Fedik commented Jul 2, 2015

@JoomliC I guess no one 😄
but this https://github.com/dbushell/Pikaday + this http://momentjs.com/ looks not bad, only problem that Pikaday does not support the time

@cyrezdev
Copy link
Contributor

cyrezdev commented Jul 2, 2015

@infograf768 i've worked all June to make my calendar module working with Jalali calendar, and yes, it is a challenge to do this!
@Fedik Thanks for link, but seems not to take care of jalali calendar (only Gregorian) or i'm wrong...
In all cases, my idea is a calendar picker with multiple options : date, time, year, month... (at choice from the field).
Could be useful to have only a time picker or a year picker if you dont need the full calendar. At least, a time selector would be useful (which one is already in the current code, but not active). ;-)

@Fedik
Copy link
Member

Fedik commented Jul 2, 2015

@JoomliC internationalisation by http://momentjs.com/ , but to be honest I do not know what there displaied on demo page 😄 :

screen 2015-07-02 16 31 01 843x825

@cyrezdev
Copy link
Contributor

cyrezdev commented Jul 2, 2015

Yes for translation, but don't convert the display to Jalali calendar...
So, this one bootstrap script using moment.js : https://eonasdan.github.io/bootstrap-datetimepicker/ seems nice, but don't think it does it too...
Don't know if exists one datetime picker saving input in SQL date, but displaying in culture calendar...

@minijoomla
Copy link
Contributor

@infograf768
I added jalali date & hijri date to jquery ui datepicker before.
check this minijoomla/jquery-ui@3aede66

jquery/jquery-ui#986

@minijoomla
Copy link
Contributor

check this http://keith-wood.name/calendarsPicker.html
A jQuery plugin that provides a datepicker with support for various world calendars.

@cyrezdev
Copy link
Contributor

cyrezdev commented Jul 4, 2015

check this http://keith-wood.name/calendarsPicker.html
A jQuery plugin that provides a datepicker with support for various world calendars.
Thanks, i've tested it online already, but it seems that this one set locale on header, so may not be the best behavior to integrate into Joomla CMS...
In all cases, thank you for all the links!

Do you know what's new about jquery-ui globalize ? (jquery/jquery-ui#986)

@minijoomla
Copy link
Contributor

@infograf768
Copy link
Member

The new fa-IR pack for 3.4.3 now includes the new js files.

@saeedsol1
Copy link

3.4.3 have bug
After update new pack fa-IR 3.4.3 in rsform thank you editing not saved

@infograf768
Copy link
Member

I guess rsform needs also an update. You should contact the developer as it is a commercial extension.

@majidmahdavi
Copy link

special thanks to all of you for helping out.

after updating joomla to 3.4.3 and fa-IR language pack to 3.4.3v2 (the latest one you have mentioned)
whole problem in Article solved, but in K2 Items there is still a bug:

on Adding new Item (When no date chosen yet), date printed in HTML source in Jalali format , so the datetime picker try to convert it again to Jalali and result will be so wrong date.

the only thing that working right, is on submitting form ( when i choose correct date by picker) and save the form, before saving, date converted to Georgian, but again when form loaded, it has printed Jalali date in HTML and again like new state

summary:
everything is fine when submitting form
but when form loaded ( adding new item, or editing item) it shows jalali date in HTML

solve proposal:
Date have to be printed in Georgian in Date input HTML and have to be converted to jalali in run time

my question:
how to stop k2 to not convert date in jalali in HTML Source?

@majidmahdavi
Copy link

excuse me, i wasn't so familiar with rules in here, i opened an issue in K2 getk2/k2#247

@majidmahdavi
Copy link

i got the answer by myself.

i clearly found out, date in joomla forms (that are related to database) have to be in Georgian format, and never have to be converted to user language in html source, just manipulating it by javascript in runtime for viewing!

@farazwebman
Copy link

I upgrade my joomla to 3.4.4 and install v3.4.4 v2 persian lang pack but i have a problem with creation date after update !!!!

@infograf768
Copy link
Member

@farazwebman
Can you explain which problem you have and with which browser?
For me it is working fine.

screen shot 2015-10-12 at 12 42 18

@farazwebman
Copy link

@infograf768
after publish when I want to update an article after save create time change to 777/../.. for every time I press save button create time has change .....
bud update time is correct !
after save if you change administrator lang to EN time change to 1394 (it must be 2015)
firefox 41.0.1

@infograf768
Copy link
Member

If it works for Update date but not for Create date, it looks unrelated to the Persian pack Jalali calendar.
Please post in the Persian forum http://forum.joomla.org/viewforum.php?f=102

@dgrammatiko
Copy link
Contributor

@farazwebman do you get any console errors?

@infograf768
Copy link
Member

@dgt41
the persian 3.4.4.2 lang pack calendar contains the changes from
#7643

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests