?
avatar farhadst
farhadst
1 Jul 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

avatar farhadst farhadst - open - 1 Jul 2015
avatar infograf768
infograf768 - comment - 1 Jul 2015

Confirmed...

avatar dgt41
dgt41 - comment - 1 Jul 2015

Is there a JS error logged?

avatar zero-24 zero-24 - change - 1 Jul 2015
Labels Added: ?
avatar infograf768
infograf768 - comment - 1 Jul 2015

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

avatar farhadst
farhadst - comment - 1 Jul 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

avatar zero-24 zero-24 - change - 1 Jul 2015
Category JavaScript
avatar zero-24 zero-24 - change - 1 Jul 2015
Status New Confirmed
avatar mamool
mamool - comment - 1 Jul 2015

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

avatar infograf768
infograf768 - comment - 2 Jul 2015

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 )

avatar Fedik
Fedik - comment - 2 Jul 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%

avatar farhadst
farhadst - comment - 2 Jul 2015

@fedik
i did tested this code and not work

avatar Fedik
Fedik - comment - 2 Jul 2015

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

avatar infograf768
infograf768 - comment - 2 Jul 2015

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.

avatar farhadst
farhadst - comment - 2 Jul 2015

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

avatar zero-24 zero-24 - close - 2 Jul 2015
avatar zero-24
zero-24 - comment - 2 Jul 2015

Thanks for the feedback I'm going to close here :smile:

avatar zero-24 zero-24 - change - 2 Jul 2015
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2015-07-02 10:23:45
Closed_By zero-24
avatar zero-24 zero-24 - close - 2 Jul 2015
avatar JoomliC
JoomliC - comment - 2 Jul 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.

avatar Bakual
Bakual - comment - 2 Jul 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

avatar dgt41
dgt41 - comment - 2 Jul 2015

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)

avatar farhadst
farhadst - comment - 2 Jul 2015

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

avatar infograf768
infograf768 - comment - 2 Jul 2015

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

avatar JoomliC
JoomliC - comment - 2 Jul 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 ;-) )

avatar infograf768
infograf768 - comment - 2 Jul 2015

Many people tried, without success until now.

avatar Fedik
Fedik - comment - 2 Jul 2015

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

avatar JoomliC
JoomliC - comment - 2 Jul 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). ;-)

avatar Fedik
Fedik - comment - 2 Jul 2015

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

screen 2015-07-02 16 31 01 843x825

avatar JoomliC
JoomliC - comment - 2 Jul 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...

avatar mhehm
mhehm - comment - 2 Jul 2015

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

jquery/jquery-ui#986

avatar mhehm
mhehm - comment - 2 Jul 2015

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

avatar JoomliC
JoomliC - comment - 4 Jul 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)

avatar infograf768
infograf768 - comment - 4 Jul 2015

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

avatar saeedsol1
saeedsol1 - comment - 7 Jul 2015

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

avatar infograf768
infograf768 - comment - 7 Jul 2015

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

avatar majidmahdavi
majidmahdavi - comment - 31 Jul 2015

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?

avatar majidmahdavi
majidmahdavi - comment - 31 Jul 2015

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

avatar majidmahdavi
majidmahdavi - comment - 31 Jul 2015

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!

avatar farazwebman
farazwebman - comment - 12 Oct 2015

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 !!!!

avatar infograf768
infograf768 - comment - 12 Oct 2015

@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

avatar farazwebman
farazwebman - comment - 14 Oct 2015

@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

avatar infograf768
infograf768 - comment - 14 Oct 2015

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

avatar dgt41
dgt41 - comment - 14 Oct 2015

@farazwebman do you get any console errors?

avatar infograf768
infograf768 - comment - 14 Oct 2015

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

Add a Comment

Login with GitHub to post a comment