Serhioromano / bootstrap-calendar

Full view calendar with year, month, week and day views based on templates with Twitter Bootstrap.
http://bootstrap-calendar.eivissapp.com/
MIT License
3.02k stars 1.29k forks source link

Is it possible to start the calender from a different time zone #426

Open shahidkarimi opened 10 years ago

shahidkarimi commented 10 years ago

In the database my profile has Australia/ACT time zone. Suppose I login from a computer from London with Europe/london time zone. My calender should draw according to australia/ACT.

How can we do that?

eleazan commented 10 years ago

Yeah, its possible

If you get the events_source as function, you receive 3 parameters...

start, end, and timezone.

EX:

var calendar = $("#calendar").calendar(
            {
                tmpl_path: "/tmpls/",
                events_source: function (start, end, timezone) { 
                    console.log("Time start: "+start+" & Time end: "+end + " & Timezone: "+timezone);
                    return []; 
                }
            }); 

And with that, you can adjust the time to the timezone desired ;)

moonrays00 commented 10 years ago

where did you put it calendar.js?