Client-side only extension for vlaCalendar v2.1

The initial vlaCalendar was developed for use with database data. So the calendar uses AJAX calls to PHP parsed documents. This made the calendar only usable for users who have a PHP server.

Huy Do and I developed an extension that makes the vlaCalendar AJAX-less, and thus PHP-less: the client-side only extension for vlaCalendar v2.1.

Download

Client-side only extension v1.0.1
for vlaCalendar v2.1.x
Download Vista-Like Ajax Calendar Client-side only extension (.rar)5.8 kB .rar
Download Vista-Like Ajax Calendar Client-side only extension (.zip)6 kB.zip

Usage

This extension extends the normal vlaCalendar with AJAX-less functionality, and offers the same features as the original vlaCalendar: so first download and install vlaCalendar version 2.1. You can delete the PHP files which reside in the inc/ directory.

After installing vlaCalendar v2.1 place the extension javascript files with the other files in the directory jslib/. Include the javascript file

  • vlaCal-v2.1-clientside.js
    OR
  • vlaCal-v2.1-clientside-compressed.js

within the head of your HTML document, after the original vlaCalendar included javascript file (vlaCal-v2.1.js).

Your head code should look something like this:

  1. <script type="text/javascript" src="jslib/mootools-1.2-core.js"></script>
  2. <script type="text/javascript" src="jslib/vlaCal-v2.1.js"></script>
  3. <script type="text/javascript" src="jslib/vlaCal-v2.1-clientside.js"></script>

Include either the compressed or normal version of the file. The normal version contains whitespace and comments useful for developing purposes.

Author rcz Time Sep 6, 2008 Comment on 'Client-side only extension for vlaCalendar v2.1' Add comment Bookmark 'Client-side only extension for vlaCalendar v2.1' Bookmark Permalink to 'Client-side only extension for vlaCalendar v2.1' Permalink
Bookmark 'Client-side only extension for vlaCalendar v2.1' to Netvouz Bookmark 'Client-side only extension for vlaCalendar v2.1' to Facebook Bookmark 'Client-side only extension for vlaCalendar v2.1' to Furl Bookmark 'Client-side only extension for vlaCalendar v2.1' to Technorati Bookmark 'Client-side only extension for vlaCalendar v2.1' to Stumble Upon Bookmark 'Client-side only extension for vlaCalendar v2.1' to Digg Bookmark 'Client-side only extension for vlaCalendar v2.1' to Del.icio.us

Comments (49)

Comment author zeineath Time Sep 8, 2008 02:58 GMT #1
And here we are with a friend of mine thinking of converting the calendar to clientside just now.... Thanks a lot! Was really hoping we could already use this really cool tool for our projects.. Face: Wink
Comment author Jem Comment author email jemjabella86<at>gmail.com Time Sep 29, 2008 01:45 GMT #2
Hi - great script here, it's exactly what I'm looking for. Only problem is, I need to implement the calendar on a commercial website. Face: Crying

Do you have any plans to release it under a license that allows use in this manner and/or have an optional license fee?

I'm desperate for a script as good as yours so if you're willing to discuss the possibility of this being used in a commercial setting please do contact me as soon as possible Face: Happy
Comment author C Kras Comment author email christiaan<at>depoort.nl Time Sep 30, 2008 03:01 GMT #3
Hi. Great tool!

I've discovered a rather anoying bug in Firefox 2.0.0.17. I wanted to mail it to you but I couldn't find a contact address.

When I haven't set a default date and I open te datepicker it selects the current date (30 sept. 2008), which of course is correct.

However, if I select one of the greyed dates that is in the same row as dates of the current month (in the example 1 to 4 October) it returns the year 108, instead of 2008. The only settings I use are

separator: '-',
leadingZero: true

Weird thing is that it doesn't happen with your examples. It works fine in Internet Explorer 7.
Comment author rcz Time Sep 30, 2008 10:58 GMT #4
Hi. Great tool!
I've discovered a rather anoying bug in Firefox 2.0.0.17. I wanted to mail it to you but I couldn't find a contact address.
When I haven't set a default date and I open te datepicker it selects the current date (30 sept. 2008), which of course is correct.
However, if I select one of the greyed dates that is in the same row as dates of the current month (in the example 1 to 4 October) it returns the year 108, instead of 2008. The only settings I use are
separator: '-', leadingZero: true
Weird thing is that it doesn't happen with your examples. It works fine in Internet Explorer 7.
It seems the client-side only plugin had a bug: a wrong date functions was used in the first outside days row. You can download the new version of the client-side plugin; version v1.0.1.
Thanks for reporting the bug fellow dutchman Face: Happy.
Comment author Konstantinos Time Oct 1, 2008 10:07 GMT #5
Hello, great work by the way.
I have a problem using the calendar.
everything works great but on the input type="text" that i am using it i have a onchange event. However this event does not get fires when i use the calendar. can you help me?
Comment author rcz Time Oct 1, 2008 11:40 GMT #6
Hello, great work by the way. I have a problem using the calendar. everything works great but on the input type="text" that i am using it i have a onchange event. However this event does not get fires when i use the calendar. can you help me?
Onchange function doenst get fired if the element value is set by javascript.
You'll need to fire it manually: add "this.element.onchange()" in the vlaDatepicker.pick function.
Comment author C Kras Comment author email christiaan<at>depoort.nl Time Oct 2, 2008 04:35 GMT #7
Thanks rcz. It works fine now.
Comment author Konstantinos Comment author email mythodeia<at>gmail.com Time Oct 3, 2008 09:33 GMT #8
Thank you for taking the time to answer.
In which file should i add it to?You mean the
vlaCal-v2.1.js?
i see a function near line 285 :
pick: function(_date) {.....
because i am just learning javascript can you point out where exactly should i place it and if i should just write what you told me this.element.onchange() or anything more?

thank you very much again
Comment author rcz Time Oct 6, 2008 08:39 GMT #9
Thank you for taking the time to answer. In which file should i add it to?You mean the vlaCal-v2.1.js? i see a function near line 285 : pick: function(_date) {..... because i am just learning javascript can you point out where exactly should i place it and if i should just write what you told me this.element.onchange() or anything more? thank you very much again
Yes, vlaCal-v2.1.js.
this.element refers to the input element in which the date is in. So if you want to fire the onchange of that element you will need to call it manually with this.element.onchange(). The best is if you put it at the end of the function pick.
Developing is trial and error so play around.
Comment author js2 Time Oct 24, 2008 02:04 GMT #10
Great work! Very like this scripts. Face: Happy

Thanks and keep going to improve it better!

LGBJST
Comment author molask Comment author email manuel.molaschi<at>openmindonline.it Time Oct 29, 2008 05:21 GMT #11
Hi, I also need (like jem) to implement the calendar on a commercial website.

Can you contact me for discussing a custom license (under payment?)

Thank you a lot
Comment author parapapat Time Nov 4, 2008 04:25 GMT #12
Hi, very nice work!! But I'm a little lost, because I'm new... I'm working with struts, an I would like to use your calendar, but I don't know if I need AJAX or anything else, because I can't get your calendar running... I will appreciate very much any help. Thank you!!
Comment author Matt Comment author email matt<at>elitespeeddating.co.uk Time Nov 5, 2008 04:39 GMT #13
Yes, this is nice indeed...

I am trying to use it in a admin secetion on my website and want it in the osx style, but when I add the style it stays as the default one.

Everything else works fine appart from that. The only change I have made is I put everything in a folder called /mootools. I have changed the dirs for everything and the functions and default style all work and display,

Any ideas please?

Thanks, Matt...
Comment author paced Time Nov 14, 2008 09:44 GMT #14
Hi,

This calendar is damn nice! This is the best good looking calendar I could find on the net. Thanks for this script! I've been exploring this nice script half day long until I understand how to get use of the options and arguments.

However, Ajax request to PHP pages could turn down the beauty of this calendar when I use a slow internet connection. I rather go for the client-side extension of this. But the thing is, I couldn't get the calendar working using this extension. No content shows up as I toggle the datepicker. I really need to use this client-side extension instead of the AJAX request. Perhaps you can come out with a demo page for this extension.

Thanks again,
paced
Comment author paced Time Nov 14, 2008 09:53 GMT #15
Oopsy..

In addition to my comment above, to ensure the script with the client-side extension is really not reading the PHP files, I have deleted the '/inc' folder and then the disappearing content started.

Thanks..
Comment author BlackRussian Comment author email nekromad<at>gmail.com Time Nov 18, 2008 04:08 GMT #16
This is great work i have been looking for a PHP calendar that works like ASP.NETs Ajax calendar for some time now. a note on the onchange event.if you use this.element.onchange(). you will get an error in FireFox. a safer way is to use teh following code
  1. onchange = this.element.getAttribute("onchange");
  2.             if (onchange)
  3.                 eval(onchange);


i add this at line 303 in vlaCal-v2.1.js. hope this helps someone. again great work.
Comment author Dado Time Nov 18, 2008 03:55 GMT #17
Hi, I really like your datepicker's navigation, it's well thought of, kudos on that, but I'd like to see some features:

- ability to constraint dates, for example "must be in the future" or "must be (prior to|later then) date x/y/z"

- ability to bind to another date so we can have a start date / end date functionality (end must not be before start, this is related to the above wish)

- simple timepicker! Face: Happy

- custom format (for example, yyyy-mm-dd HH:MM:SS, needed for the timepicker)

As I'm rather good in MT, I'd like to modify your script to
Comment author Dado Time Nov 18, 2008 03:56 GMT #18
(whoops) ...to do that, or at least some of it. Would that be OK? Face: Grin
Comment author Adam Time Nov 21, 2008 01:12 GMT #19
I don't know what I've missed here, but I just can't get this to work. I'm trying it on the example html file included with the download.

I have unzipped the vlaCal-v2.1.1 into its own folder, deleted the inc/ folder, and copied in the client side files to the jslib folder. Then I've included the clientside file after the vlaCal-v2.1.js file. No worky though. Clicking the text fields does nothing, and produces no error.

Can anyone please upload a zip of the package with the example file working with this clientside script? Would be a great help!
Comment author Werner Time Dec 9, 2008 09:40 GMT #20
Hi!

Do you plan to introduce the ability to link two calendars together, to allow end-users to select start and end dates in a linked-calendar fashion?

Also, please advise on commercial usage of the class, maybe I overlooked it on your site?

Comment author ehab Comment author email ehab.abbyday<at>gmail.com Time Dec 15, 2008 08:38 GMT #21
hi

i will add my voice to [ Dado ]'s comment #17 it will really be perfect for databound coding.

thanks for any consideration
Comment author Christiaan Kras Comment author email christiaan<at>depoort.nl Time Dec 17, 2008 01:22 GMT #22
Found another bug. But somehow I'm unable to reproduce it. I selected 31-12-2008, but the year was altered to 2009, so instead I got 31-12-2009 returned.
Comment author Christiaan Kras Comment author email christiaan<at>depoort.nl Time Dec 17, 2008 01:33 GMT #23
Never mind. My fault, I screwed up with locales
Comment author Ricardo Time Dec 24, 2008 04:45 GMT #24
Hi there,

I'm trying to put up a new site with some free and other commercial options.

Can I use this?

Thanks
Ricardo
ricardo dot nuno dot rodrigues aaat hotmail dot com
Comment author Angelo Comment author email angelolr<at>hotmail.it Time Dec 31, 2008 01:48 GMT #25
I've seen that today 31/12/2008 the client side don't work well.
Comment author Tommy Comment author email tommy.vrabel<at>gmail.com Time Jan 3, 2009 02:38 GMT #26
Hi,
I would like to ask, if it is possible to use the example 3 in order to click on a single day and save the result somewhere
Comment author tommy Comment author email tommy.vrabel<at>gmail.com Time Jan 3, 2009 02:43 GMT #27
sorry,

thought example 5
Comment author FMS Time Jan 22, 2009 05:52 GMT #28
Quick question...

I'm using this inside of an update panel and it is working correctly.

I have a search button that binds a gridview's contents according to the selected start/end dates (both start and end inputs are set by the vlaCalendar).

Once I databind the gridview, the vlaCalendar stops working until the page is refreshed....is this due to the partial post back? Should I be adding something to the search event handler?

Thanks in advance...
Comment author FMS Time Jan 22, 2009 08:09 GMT #29
Nevermind the previous post...I believe the DOM doesn't reload when the input is inside the update panel. I took the input fields outside of the updatepanel and it is behaving as expected.
Comment author Jonathan Comment author email jonatan_2j<at>hotmail.com Time Jan 27, 2009 07:23 GMT #30
HOLA, COMO PUEDO OBTENER LAS FECHAS DE DICHOS CAMPOS...?
Y MOSTRARLOS POR EJEMPLO EN UN ALERT();

PORFIS AYUDENME... :(
Comment author pero Time Jan 30, 2009 07:59 GMT #31
Today my calendar shows two Mar months, instead of Feb and Mar :-) I will leave to you the pleasure of discovering where is the bug (hint: mkdate).
Comment author exocety Time Jan 30, 2009 09:36 GMT #32
Hi

I 've the same bug ! It is impossible to show the February month where the selected year is not a leap year ??
On January month, When i want to click to the next month, i skip February month and go to March !!! And after, i is impossible to go back, the calendar is blocked on March...
That appears only when i use the client-side (not the ajax version) and when the clock of my computer system is on january

Could you make a new version of this JS without his bug ?
Comment author exocety Time Jan 30, 2009 09:48 GMT #33
I confirm that the bug appears only when the date is between 28 and 31 of each month !!!

Thanks in advance
Comment author pero Time Jan 30, 2009 09:53 GMT #34
Bug also appears at any 31st day of month - next month will not be!
Comment author pero Time Jan 30, 2009 09:58 GMT #35
Fix (unofficial, of course):

In vlaCal-v2.1-clientside-v1.0.1.js change:
...
if($defined(year)) date.setYear(year);
if($defined(month)) date.setMonth(month);
if($defined(day)) date.setDate(day);
...

into:
...
if($defined(year)) date.setFullYear(year, month, day);
...

Comment author exocety Time Jan 30, 2009 10:44 GMT #36
THANKS !!! it seems to work !
Comment author Žan Comment author email graddd<at>gmail.com Time Mar 10, 2009 02:02 GMT #37
Hello.
First, i'd like to thank you for this amazing piece of JS / HTML . It's really great!

But, i want to do something (a popup when you click on a date, dynamic JS popup with details about the day) and I would like to know what to use instead of 'document.getElementById("element").style.display="block"'

I can't get it to show or hide anything. What should I use or how should I do it?

Thanks in advance, Žan (slovenia).
Comment author Žan Comment author email graddd<at>gmail.com Time Mar 10, 2009 02:06 GMT #38
Forgot to mention, I know that there is PHP code inside it and i'm changing the onclick on dates in month.php, but i can't get the
'document.getElementById("element").style.display="block"'
to work.

Sorry for double post, Žan.
Comment author Žan Comment author email graddd<at>gmail.com Time Mar 10, 2009 03:30 GMT #39
(Triple post, sorry, but gotta share this with noobies like me)
Hello, found a solution for the problem...
getElement('div[class=elementsclass).style.display='none'

..and that's how to hide it.
Comment author C Kras Comment author email christiaan<at>depoort.nl Time Mar 31, 2009 08:57 GMT #40
There are some serious issues with this version of the vlaCalendar. Try selecting a date in april 2009... It just isn't there. Months are messed up, e.g. it shows the following months for 2009: Jan, Mar, Mar, May, May, Jul, Jul, Aug, Oct, Oct, Dec, Dec.

I'm going to fall back to the PHP version.
Comment author ehab Time Apr 3, 2009 07:19 GMT #41
@ christiaan<at>depoort.nl
i can select any date in April, everything is fine.

i am just wondering what will be the future for this calendar. a lot of potential but needs time to features so on ... i am thinking to really get my hands dirty with it and see what i end up with
Comment author C Kras Comment author email christiaan<at>depoort.nl Time Apr 6, 2009 08:37 GMT #42
Maybe it's fine now, but when trying it in on March 31st all was messed up. So I had to switch back to the PHP version. Which isn't a very big deal, although I don't really like it how it needs to use AJAX to get it's date, as this version *almost* works perfect without PHP.
Comment author Juan Comment author email juancarlos_la<at>hotmail.com Time Jun 1, 2009 02:26 GMT #43
Hola. Tengo un problema si muevo las carpetas images, inc, jslib y styles a una subcarpeta. Me muestra el cuadro, pero no me carga las fechas. Porfavor, si pudieran ayudarme con esto. Tengo el archivo en /index.php, y las carpetas fueron movidas a /lib/calendar/
Comment author Rob V Comment author email rbv<at>verzera.com Time Jun 2, 2009 04:10 GMT #44
Great Calander.
One great improvement would be to have an option to allow allow dates in the future.
Also - allow an offset of the current date displayed. Ie - I want the date to default to tomorrow, currently I just set prefillDate to false and fill it in w/ a PHP var.

But only allowing future dates would be great!
Comment author Yosh Comment author email yosh<at>nac-inc.org Time Jun 4, 2009 09:11 GMT #45
I know it says it can work on IE6 and IE7, but when I use IE8 the navArrows don't work. Everything else seems to work. Any fix?
Comment author yosh Comment author email yosh<at>nac-inc.org Time Jun 10, 2009 05:00 GMT #46
When I go to print the page, all the calendar views also print...any way to hide then for printing?
Comment author Ibntel Comment author website www.ibntel.com Time Jun 30, 2009 08:44 GMT #47
http://www.ibntel.com
Each year, Americans spend billions of dollars on long distance phone service. By some estimates, at least one-fifth of that amount is wasted on excessive charges. Fortunately, by making smart decisions regarding long distance plans, consumers can avoid wasting hard earned dollars.
Ibntel
Comment author Ibntel Comment author website www.ibntel.com Time Jun 30, 2009 08:45 GMT #48
http://www.ibntel.com
Each year, Americans spend billions of dollars on long distance phone service. By some estimates, at least one-fifth of that amount is wasted on excessive charges. Fortunately, by making smart decisions regarding long distance plans, consumers can avoid wasting hard earned dollars.
Ibntel
Comment author Developer Time Jul 3, 2009 03:11 GMT #49
This calendar does not work in IE8. Null pointer in Ajax version. Any fix available?

Add comment

Your name
Your email or website (optional)
Icon
Confirmation code
Confirmation code
Message
face:happy face:glasses face:devilgrin face:crying face:grin face:laughing face:sad face:kiss face:shocked face:wink face:monkey face:angel