Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By SurfMan

Thread: datetimepicker

  1. #1
    JohanB is offline Member
    Join Date
    Feb 2017
    Posts
    1
    Rep Power
    0

    Default datetimepicker

    Hi all,
    I'm starting to learn Java, but I desperately need to adjust a piece of code right now:

    I have this code which trims the date from a 'enddate' box.
    What I want now is to adjust this code so that it returns 'startdate' 17:00 h

    So: startdate = 15-2-2017 08:00
    enddate auto fills with: 15-2-2017 17:00

    Can anyone make something out of this?
    Thanks!

    var startDate = $('.pss_fieldname_begindatetime input').val().substring(0,$('.pss_fieldname_begind atetime input').val().indexOf(" ")).trim();

    var dateTimeInput = $(this).find("input");
    dateTimeInput.on("focus", function() {
    setTimeout(function(){
    dateTimeInput.datetimepicker({
    datepicker:false
    });
    }, 500);
    });

    var isDisallowedKeycode = function(keycode){
    return (
    ((keycode >= 48) && (keycode <= 90)) || ((keycode >= 96) && (keycode <= 111)) || ((keycode >= 186) && (keycode <= 22))
    );
    }

    dateTimeInput.on("keydown", function(event){
    if (isDisallowedKeycode(event.which)){
    return false;
    }
    });

  2. #2
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,989
    Rep Power
    8

    Default Re: datetimepicker

    This is a Java forum. Not a JavaScript forum. If you're not sure what language you're learning, I see some trouble down the road for you in the future...

    DarrylBurke likes this.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  3. #3
    benji2505 is offline Senior Member
    Join Date
    Sep 2014
    Location
    MA, USA
    Posts
    398
    Rep Power
    5

    Default Re: datetimepicker

    'love that image.
    It is a widely experienced misunderstanding though, you find the Java books usually in the Javascript section and vice versa.

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,989
    Rep Power
    32

    Default Re: datetimepicker

    Moved out of Java section
    If you don't understand my response, don't ignore it, ask a question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •