Simple Datepicker v1.0

Release Notes

ToDo:

  • Let the user choice the interval between the dates
  • Internationalization
  • Let the user doesn't select a date
  • Reporting error:  When selecting a date in profile (say, using this to pick date of birth) the selected day and displayed day is 1 day off.  I.E., selecting July 5 as the intended date of birth will always come up July 4 on the profile.  After 5 tries, the user just decided to set date of birth as July 6 so it will come up as July 5 on the profile.

    Bug #2 is the default date of 1.  If user ignores to select a date and let the default take over, say, the usuer's birthday is truely Jan 1 (or March 1) where they just adjusted the month but not the date, an error will occur stating that a field is missing.

  • Hi,

    Thanks for your feedback. The first one is probably relative to Elgg: also on the profile_manager's page there is some comment on this... it doesn't happens to me.

    For the second, I'll add this to the toDo list.

  • @SGr33n

    Hello I have been playing with your new datepicker plugin and I really like the layout of it. I was having problems running the datepicker in profile_manager on 1.7 but after installing this plugin it solved that problem.

    I still have the problem, as Carlitosho stated of the date being saved as 1 day off. After playing with your code I found a piece of code:

     var dayopt = <?php echo $bd_day -1; ?>;

    This code subtracted 1 day from the edit form each time the profile was saved. I'm kind of a newbe with php and do not understand the reasoning behind this code but when I cahnged it to:

     var dayopt = <?php echo $bd_day -0; ?>;

    It no longer subtracted the date on the edit field. Still when the profile is saved the date is 1 day off.

    As far as Carlitosho's # 2 bug I haven't seen that on 1.7. In my site the date Dec. 1 becomes Nov. 30.

    I have read where this has been solved through changing the offset of the timezone but I haven't had any luck with this so far.

    Any ideas would be a big help. And Thanks for all your hard work.

     

  • hello again.

    I have been doing latter logic programing for close to 30 years and I was just thinking, zero is a digit and if the core of elgg is counting this digit it might explain why dates are 1 day off, say you input a date of Jan. 3rd. the input number is 3:

    0=1, 1=2, 2=3

    So you get an ouput of Jan, 2 ?????

    As I have said before I am a newbe in Java and php so I'm not sure how to handle this in these programing languages, but in latter logics I would simply add 1 to the starting point.

  • There is a reason if I added this piece of code :P

    The select starts from zero, the days from one, so to get the select number you have to subtract 1 from the day ;) (dayopt = "day option")

    In my opinion the error is for the timezone, I added a fix yet, I don't know y it doesn't work for you. It does for me. Anyway the problem is not for the day number, but the hours (1 Dec 00.00 - 1 hour is 30 Nov).

    Make an empty php page and add <?php echo date("Z"); ?>

    Then load it from your webserver and make me know the result.

  • Hi

    When the code <?php echo date("Z"); ?> is added to my server the results are -28800

  • So you're -8 hours CET, confirm?

  • Yes I am EST in North Carolina

  • So...

    Set a day and save it. Then come back to the edit page and view the HTML source.
    Tell me please the value for hidden field named datepicker_hidden and the day you entered.

     

  • Right now the only place I am using a datepicker is in profile_manager, where is the data your talking about stored in elgg?

  • By the way, if I change the line in your code:

     timestampdate = timestampdate + <?php echo date("Z"); ?> ;

    to:

     timestampdate = timestampdate + 28800 ;

    as a positive numbr everything works great on my site,,,,, could it be that the negitive -28800 is subtracting the day in the output?

    Also the previous line we talked about:

    var dayopt = <?php echo $bd_day -1; ?>;

    works the way it should with the positive 28800 number replaceing the php time offset. 

Stats

  • Category: Misc
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 1181
  • Recommendations: 3

Other Projects

View SGr33n's plugins