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

Change in calendar options does not get triggered after refresh #30

Closed
luigi37 opened this issue Apr 12, 2015 · 11 comments
Closed

Change in calendar options does not get triggered after refresh #30

luigi37 opened this issue Apr 12, 2015 · 11 comments

Comments

@luigi37
Copy link
Collaborator

luigi37 commented Apr 12, 2015

My app can change language on the fly.
I change the options of the Calendar to have months and days in another language.
Calling "refresh" does not update the text...
Am I missing anything?
Thanks!

@luigi37
Copy link
Collaborator Author

luigi37 commented Apr 12, 2015

In effect with this code it seems to work:

    $("#calendar").data("jqm-calendar").settings.months=["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"];
$("#calendar").data("jqm-calendar").settings.days=["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa"];    
$("#calendar").trigger('refresh', new Date());

Except that the days do not get updated...

@jwgmeligmeyling
Copy link
Owner

I never thought of the use of refreshing the calendar for different translations. Both the start day of the week (eg. on sunday or monday) and the labels for the days are rendered in the init() function and not in the update function.

See: https://github.com/JWGmeligMeyling/jqm-calendar/blob/master/jw-jqm-cal.js#L80

I think it's quite easy to fix, but unfortunately I wont have the time for this now..

@luigi37
Copy link
Collaborator Author

luigi37 commented Apr 16, 2015

Thanks, I will give it a try and if succesfull I'll commit the changes...
Do you mean I should move
the start day of the week (eg. on sunday or monday) and the labels for the days
to refresh() ?

@jwgmeligmeyling
Copy link
Owner

Yes I meant that, but I believe you already found out 😉

@luigi37
Copy link
Collaborator Author

luigi37 commented Apr 21, 2015

I did not find an easy way to do that... thanks for any code change from your side :-)

@jwgmeligmeyling
Copy link
Owner

Then i'll reopen. Unfortunately I don't have the time to get involved on this issue now 😢

@luigi37
Copy link
Collaborator Author

luigi37 commented Apr 21, 2015

Thanks a lot :-)

@luigi37
Copy link
Collaborator Author

luigi37 commented May 7, 2015

Hi Jan, any update here? Got the first user noticing it :-) ...

@jwgmeligmeyling
Copy link
Owner

I would suggest just destroying the calendar and creating another one with the new settings object. I have no time to investigate this issue in the next few weeks.

@luigi37
Copy link
Collaborator Author

luigi37 commented May 15, 2015

Hi Jan,
that would have created the need to reassociate the events and stuff I added....
I created a pull request which add an id to each day label and through that change it on the fly...
Let me know it ok and if you can merge
Thanks

@luigi37
Copy link
Collaborator Author

luigi37 commented Sep 23, 2015

Change implemented

@luigi37 luigi37 closed this as completed Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants