Date Picker PHP Class 1.0.1

Monday, September 04, 2006
,

A new version of the Date Picker PHP Class has been released. Read further to see what is new in this version of the script.

What's new in this version:

  • the date/time picker now pops up as a modal window (it will stay on top of other windows until closed) and will also have the focus by default - thanks to Johan van Ieperen
  • added the possibility to define for each language how the abbreviations for names of months and days should be - thanks to Johan van Ieperen
  • the manual was confusing about how to use another language file - thanks to Johan van Ieperen
  • fixed a bug that would scramble up days on months where first day of the week was on a Sunday - thanks to Achim from Germany
  • added german language translation (thanks to Wassilios Meletiadis)
  • added dutch language translation (thanks to Johan van Ieperen)

43 comments:

  1. Anonymous said...

    Very cool and useful script. Can't tell you where I've used it, as it is in protected space (sorry.)

    To move from 1.0 to 1.0.1 do I need to update all the files?

  2. Stefan Gabos said...

    i am glad you found good use for it.

    and yes, all the files need to be updated from 1.0 to 1.0.1

  3. mar251 said...

    Hi Stefan. thanks for the imageresize class.. just wanto to know if its preserves png 24 transparency, cause i tryed it with no success

    thanks!

  4. Anonymous said...

    Hi, i've just used the files and the are really usefull. Thank you.

    But there seems so be a small little problem in the function insert_id($resource = "") because is doesn't return nothing.

    First tried to call the mysql_insert_id() function and it returned the correct value. So studied a bit your code, and thing you have a bug.

    The database connection is keeped in the variable "link" so in the function insert_id, i guess the line 619 shouldn't be "$resource = $this->lastResult;" but should be "$resource = $this->link;".

    Changed that line and now it works fine.

    Ill leave you my email if you want to contact me: arlc83@gmail.com.

    Cheers arlc

  5. Stefan Gabos said...

    this comment is in the wrong place, man :)

    but anyway, thanks for noticing - the class doesn't preserve transparency for png24. an updated version of the class will be released this week which will contain a fix for this issue.

    thanks!

  6. Stefan Gabos said...

    grrr, another comment in the wrong place!

    anyways, thanks for finding and reporting the bug in the Database Wrapper Class.

    a new release is coming out by the end of this week (which will have this bugfix and some new methods in it) so be sure to check back.

    thanks

  7. Matt said...

    I love the date picker script, it works on my machine with web server running but when i put it online, the calendar window gives me an error! I have not altered your code in any way. Could you please help?
    http://www.qwizdom.co.uk/test/demo.php

    Your files are located: qwizdom.co.uk/test/datepicker/

  8. Stefan Gabos said...

    hi matt,

    there's probably an .htaccess file that redirects every PHP file...

    i don't know what else could it be without having access to the files

  9. Matt said...

    Thanks for the reply, Stefan. Any ideas on finding or creating a different .htaccess file? I don't see anything on our server. What commands do you use to bring up the menu and initialise it in the popup window?

  10. Stefan Gabos said...

    hi matt,

    there's a simple javascript window.open() command that calls the datepicker.php file in the /includes folder. check if that file has its rights set to 0755.

  11. SanSar said...

    hello,
    the php date picker class looks good.

    but one more feature would have been great. if it had a option to allow the range of dates to be selected by the user.

    say we dont want a user to select any date prior to today, though they apppear in calendar, they cant be selected.
    and then say in another calendar on same page, the date has to be within x days of date selected in first one...

  12. Stefan Gabos said...

    i agree sansar :)
    next version will have that. coming next week.
    thanks

  13. Joeri said...

    Hi Stefan,

    I like your class great work thumbs up!!!
    There was a small bug in the example.php

    when you pushed the button that noting showed up.
    there was no "echo" command
    echo $db->show("date")is the correct line

    I'm looking forward to the next release. and it would be great if there came a update for the datagrid class . that you could make hyperlinks in the table's and then call a other query if I have fond how to do it I will post it.

    Grtz Joeri

  14. Stefan Gabos said...

    hi joeri,

    there will be an update for the data grid class but i can't tell you when will that be as right now i got a lot of work to do at my job. :( these days i will be releasing a new class (surprise, surprise ;)) and probably in two weeks time i'll start releasing updated versions of all available classes.

  15. Jethro Mendonça said...

    Hello there

    I found it very useful, and I'd like to contribute somehow. I created the portuguese language archive and wonder how I could send it to you.

  16. Stefan Gabos said...

    just mail the language file to "ix at nivelzero dot ro" or to "noname at nivelzero dot ro"

    thanks

  17. Anonymous said...

    YEAHHHH, man this scrpt rocks, thak you so much for this script...

    but unfortunately i've used it on our intranet pages, srry.

  18. Stefan Gabos said...

    well, ok... :)
    i won't sue you just tell me where have you used my script so i can later tell "look in how many places my scripts are used!"

    or should i make my own license file?

    can anyone help with that?

  19. jr said...

    Testing the script and works great. Will you add TIME support too?

  20. Stefan Gabos said...

    what do you mean?

  21. roscoeh31 said...

    Great script. Iworks locally but on my remote server I have a problem. IE id doesn't open anything and in firefox I get "firefox doesn't know how to open this address because the protocol (d) is not associated with any program.

  22. Stefan Gabos said...

    tell me some details about your local server and about the remote one. maybe an url...

  23. Anonymous said...

    Very nice code I would like to use it but know nothing about classes.
    How about an example on how to use it for a complete novice ?
    I want to put the date into a database and so need to get the date into a variable somehow?

  24. Anonymous said...

    ...
    $dp->enableTimePicker = true;
    $dp->dateFormat = "r"; //as in rfc
    ...

    This doesn't work properly on ie7 or firefox 2.0.0.2 ... on ie7 I get only the abbreviated day (Mon, Tue, etc...) and in firefox the time / timezone offset are set to all zeros.

  25. Anonymous said...

    Hi Stefan,

    I downloaded and ran your datpicker example (the one packaged with gzip).

    It looks great, but when you click on the arrows before or after the year, the year doesn't change.

    Nor do the days in the grid change to match the month that's selected.

    It only does day changes to the field.

    Do you get the same results?

  26. Stefan Gabos said...

    i've seen this happening on some servers. it's happening because your PHP doesn't have the $_SERVER[
    "DOCUMENT_ROOT"] variable set. edit class.datepicker.php and see the line 262.

  27. Anonymous said...

    I'm having this same problem, but I am certain that my $_SERVER["DOCUMENT_ROOT"] variable is set. I can echo it to the screen on the same page as I am calling the date picker class. I see the line you mention in class.datepicker.php and I have tried inserting the actual value for the document root in there to no avail. Actually, I've had the date picker working fine on my machine for some time, but an upgrade from PHP 4.4.4 to version 5.2 seems to be likely culprit here. Any other suggestions for resolving this issue?

  28. Anonymous said...

    Hi Stefan

    Great script, worked first time on my local server and the on remote server.

    But on the remote server the actual days (ie 1,2,3 .. 30) are displayed under the wrong days in the week (ie Mon, Tue ... Sun) for example 19/07/2007 appears under Saturday not Thursday. I have tested this using IE and Opera same thing occurs.

    I hope this makes sense but if not take a look and see -
    http://www.busybee.es/demo/date_picker/examples/example.php

    Any ideas what I have done wrong and how I can fix it.

    Many Thanks

    Mark

  29. André Joubert said...

    Just downloaded vers 1.0.5...
    Great work... I was looking at 1.0.1 before and needed selectable dates which is included here.
    But it did not work....
    In class.datepicker.php at line 313 it reads ...selectedYearsRange but it should be ... selectedDatesRange.
    After the change everything is fine,except for minor spelling in french.php

  30. Anonymous said...

    Hi Stefan,

    I'm having the same problem. The month didn't change when I clicked the arrows. Is there any update about this issue? Thanks.

  31. Anonymous said...

    Hi Stefan,

    I'm having the same problem. When I clicked the arrows, the month didn't change. Is there any update about this issue? Thanks.

  32. david said...

    Clicking the month/year reloads the page but doesn't select clicked month.
    Using firefox.

    Is there an update?

  33. Anonymous said...

    Same problem as david here... Unable to select a month/year other than current.

  34. Bart said...

    I can't change the date either... I'm hoping for an update. It's a master script! I can't change the month or year, when I work with Firefox or Internet Explorer, I always get the current month / year...

  35. Stefan Gabos said...

    To everybody who has the problem with the months not changing - I think I already gave this answer somewhere but here's again: this happens because, apparently you don't have in the $_SERVER superglobal the SCRIPT_NAME index. Therefore, in the "template.xtpl" file, where it says action="{PHP._SERVER.SCRIPT_NAME}" change it to action="{PHP._SERVER.PHP_SELF}". If that still doesn't work you could hard-code the actual path. Or, you could print_r($_SERVER) somewhere in your script and see what entries you have available and what can you use as a replacement for SCRIPT_NAME/PHP_SELF. Hope this helps!

  36. Anonymous said...

    I was wondering on your calss if I can black out say for example, all Wednesdays and Saturdays? I want to be able to block out specific days. Can this be done? If so, how? Thanks in advance and this class rocks.

  37. Anonymous said...

    Thanks Stefan ... just tried looking at this little script, however, found a "bug" ...

    I have a more "strict" setup running, and the onclick in the example uses shortened PHP, instead of full the full PHP escape tag.

    See here about not using the "short tags" for public use.

    Just a minor nit ... other than that, this script works great.

  38. Anonymous said...

    I solved the datepicker navigation problem with action empty (action="{PHP._SERVER.SCRIPT_NAME}")
    activating (On) register_long_array variable in php.ini file.

    Hope this help.

    Guillermo Gomez Valcarcel
    Madrid, Spain

  39. Guillermo said...

    I solved the datepicker empty action action="{PHP._SERVER.SCRIPT_NAME}" activating (On) register_long_arrays in php.ini.

    Hope this help.
    Guillermo Gomez Valcarcel
    Madrid, Spain.

  40. Anonymous said...

    Sir,

    Is there documentation explaining how to implement this script on a simple PHP page?
    In other words...where do I put all the stuff from your zip file on my computer?

  41. Sharles said...

    Stefan,

    First of all thanks so much for Your Date Picker Class.

    I however have one problem, the class works perfect in Internet Explorer, but when I use Mozilla Firefox Browser the time is not loaded even when I select it. It just loads the date and then time defaults to OO:OO . What could the problem be?

  42. Sharles said...

    Stefan,

    First of all thanks so much for Your Date Picker Class.

    I however have one problem, the class works perfect in Internet Explorer, but when I use Mozilla Firefox Browser the time is not loaded even when I select it. It just loads the date and then time defaults to OO:OO . What could the problem be?

  43. Anonymous said...

    I am new to PHP but am hoping to deploy a website using Joomla and the date picker might just make it possible as selecting and capturing dates is fundamental.

    I have got the date picker working except that when I try to write the value back to the database the field is blank.

    $dp->show("date") does enter the date into the text box but when I test for a value it is always blank.

    Class class - thanks.

Post a Comment

GlossyBlue Blogger by Black Quanta. Theme & Icons by N.Design Studio
Entries RSS Comments RSS