20i Reseller Hosting

Faster searching and free account access

Discussion in 'Drop catching Domain Names' started by RobM, Jul 27, 2018.

  1. omcgb United Kingdom

    omcgb Well-Known Member Full Member

    Joined:
    Jan 2009
    Posts:
    1,020
    Likes Received:
    8
    I've checked the code and maxDate for the date picker is set to Jan 1970

    $(document).ready( function() {
    tmp=setTimeout(function(){
    $('#datepicker').datepicker({
    dateFormat: 'dd/mm/yy' ,
    minDate: new Date(2018, 7, 08),
    maxDate: new Date(1970, 0, 01),
    setDate: new Date(2018, 7, 08)
    });
    },400);
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
     
  3. RobM

    RobM Well-Known Member Exclusive Member

    Joined:
    Mar 2012
    Posts:
    2,082
    Likes Received:
    236
    Odd because that code is generated by php
    the line at server before being interpreted reads:

    maxDate: new Date(<? echo date("Y, ").(date("m")-1).", ".date("d"); ?>),

    Ah actually could be a combination of different login session levels. Let me see if I can recode.

    Are you logged in or looking from just visiting the page as a guest?

    *edit* try now
     
  4. omcgb United Kingdom

    omcgb Well-Known Member Full Member

    Joined:
    Jan 2009
    Posts:
    1,020
    Likes Received:
    8
    Very strange! Shouldn't the maxDate be +1 month?

    As your script files are in the header you should be able to add the <script> above </head> and remove the time delay.
     
  5. RobM

    RobM Well-Known Member Exclusive Member

    Joined:
    Mar 2012
    Posts:
    2,082
    Likes Received:
    236
    No javascript datepicker needs months from 0 to 11 and php goes from 1 to 12
    The script tags enclose a jquery document ready so now it doesn't matter where they are. The only reason I have to put that in the front page is because I want to inject php and you can't do that with js files. The timeout was put in before the document ready was, I've removed it now but that makes no difference.
    What browser/OS are you using? I should add that the line in the above posts could be completely irrelevant - if you are logged in the maxdate will obviously be whatever your account has permission to view.
     
    Last edited: Aug 8, 2018
  6. omcgb United Kingdom

    omcgb Well-Known Member Full Member

    Joined:
    Jan 2009
    Posts:
    1,020
    Likes Received:
    8
    Sorry, my point was shouldn't maxDate be greater than today?

    As before, same as you: Chrome 68 - Windows 7
     
  7. RobM

    RobM Well-Known Member Exclusive Member

    Joined:
    Mar 2012
    Posts:
    2,082
    Likes Received:
    236
    Maxdate depends on your account access. If you visit the site and you are not logged in or on a free account maxdate is obviously the same day as today. That was the code I listed.
    Any errors in your developer console? I can't repeat this issue with any browser/os combinations so is hard to get to the bottom of.
     
  8. omcgb United Kingdom

    omcgb Well-Known Member Full Member

    Joined:
    Jan 2009
    Posts:
    1,020
    Likes Received:
    8
    I am logged in and currently viewing the full list for the 11th

    No errors showing in console.
     
  9. omcgb United Kingdom

    omcgb Well-Known Member Full Member

    Joined:
    Jan 2009
    Posts:
    1,020
    Likes Received:
    8
    The delay has now gone but the maxDate is still 1970

    $('#datepicker').datepicker({
    dateFormat: 'dd/mm/yy' ,
    minDate: new Date(2018, 7, 8),
    maxDate: new Date(1970, 0, 1),
    setDate: new Date(2018, 7, 8)
    });
     
  10. RobM

    RobM Well-Known Member Exclusive Member

    Joined:
    Mar 2012
    Posts:
    2,082
    Likes Received:
    236
  11. omcgb United Kingdom

    omcgb Well-Known Member Full Member

    Joined:
    Jan 2009
    Posts:
    1,020
    Likes Received:
    8
    It works fine when I first sign in, so I think the issue is arising from logging in using cookies (remember me).

    This is after a manual login:

    1: 2018-08-08
    2: 4
    3: 6
    4: 25
    5: 2018, 7, 14
     
  12. RobM

    RobM Well-Known Member Exclusive Member

    Joined:
    Mar 2012
    Posts:
    2,082
    Likes Received:
    236
    I'll look into that.
    However I think there is only one or two cookies stored for a remember me - all other information (as the pasted above) is from server-side sessions to prevent issues. That last number is the exact same string that gets injected into the 'maxDate' and even if the system didn't recognise you as we've seen at php level it will inject todays date.
     
  13. RobM

    RobM Well-Known Member Exclusive Member

    Joined:
    Mar 2012
    Posts:
    2,082
    Likes Received:
    236
    Yep you're right - cool thanks I now have the same error and can fix it :)
     
  14. omcgb United Kingdom

    omcgb Well-Known Member Full Member

    Joined:
    Jan 2009
    Posts:
    1,020
    Likes Received:
    8
    It must be that some data is missing from the "remember me" sign in process.

    This is debug now after revisiting:

    1: 2018-08-08
    2: 4
    3:
    4: 25
    5: 1970, 0, 1
     
  15. RobM

    RobM Well-Known Member Exclusive Member

    Joined:
    Mar 2012
    Posts:
    2,082
    Likes Received:
    236
    Fixed now.
     
    • Like Like x 2
  16. omcgb United Kingdom

    omcgb Well-Known Member Full Member

    Joined:
    Jan 2009
    Posts:
    1,020
    Likes Received:
    8
    Yep, working perfectly now.
     
    • Like Like x 1
    • Agree Agree x 1