Closed farhadst closed 9 years ago
Confirmed...
Is there a JS error logged?
@dgt41 I suggest you test for yourself as there are many errors
@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
This error happened when update "core.js" in joomla 3.4.2
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 https://github.com/joomla/joomla-cms/commit/de492a6ce137286b7917bb5cd9200ea12406acaa ( https://github.com/joomla/joomla-cms/pull/6587 )
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%
@fedik i did tested this code and not work
for test calendar-setup-uncompressed.js
need to enable the Debug in global config, hope you did it? :wink:
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.
@fedik you right, after enable debug its work :) @infograf768 i have replace this files and its work calendar after save converted fine Thanks
Thanks for the feedback I'm going to close here :smile:
@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 ?
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
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 https://github.com/joomla/joomla-cms/issues/6207#issuecomment-91833886
@balvard please replace correct code and release new persian language pack and i have email correct code to persian language team
The TT coordination has sent a mail too to the fa-IR Coordinator.
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 ;-) )
Many people tried, without success until now.
@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
@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). ;-)
@JoomliC internationalisation by http://momentjs.com/ , but to be honest I do not know what there displaied on demo page :smile: :
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...
@infograf768 I added jalali date & hijri date to jquery ui datepicker before. check this https://github.com/mhehm/jquery-ui/commit/3aede66e9c60d13de2089b0af911a2dd9bb20991
check this http://keith-wood.name/calendarsPicker.html A jQuery plugin that provides a datepicker with support for various world calendars.
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 ? (https://github.com/jquery/jquery-ui/pull/986)
The new fa-IR pack for 3.4.3 now includes the new js files.
3.4.3 have bug After update new pack fa-IR 3.4.3 in rsform thank you editing not saved
I guess rsform needs also an update. You should contact the developer as it is a commercial extension.
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?
excuse me, i wasn't so familiar with rules in here, i opened an issue in K2 https://github.com/joomlaworks/k2/issues/247
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!
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 !!!!
@farazwebman Can you explain which problem you have and with which browser? For me it is working fine.
@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
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
@farazwebman do you get any console errors?
@dgt41 the persian 3.4.4.2 lang pack calendar contains the changes from https://github.com/joomla/joomla-cms/pull/7643
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! @dgt41