DateTimePicker icon indicating copy to clipboard operation
DateTimePicker copied to clipboard

event start and end date

Open tangcastor opened this issue 8 years ago • 1 comments

Hi,

I created two datetime data fields as start and end of an event. For example, I choose 25-06-2016 12:15:00 PM as the start date data field, is there a way to make the end date data field to have a +30 minutes (25-06-2016 12:45:00 PM) as the start and will not allow the minus (-) buttons to be clickable? Below is the code I am using. Thank you.

    <p>Start DateTime : </p>
    <input class="startDateTime1" type="text" data-field="datetime" data-startend="start" data-startendelem=".endDateTime1" readonly>

    <p>End DateTime : </p>
    <input class="endDateTime1" type="text" data-field="datetime" data-startend="end" data-startendelem=".startDateTime1" readonly>

    $("#dtBox").DateTimePicker({
        dateTimeFormat: "dd-MM-yyyy hh:mm:ss AA",
        maxDateTime: moment().add(2, 'months').format("D-MM-YYYY hh:mm:ss A"),
        minDateTime: moment(myFunction()).format("D-MM-YYYY hh:mm:ss A"),
        animationDuration: 100
    });

tangcastor avatar May 25 '16 05:05 tangcastor

Please try code below -

    <p>Start DateTime : </p>
    <input class="startDateTime1" type="text" data-field="datetime" data-startend="start" data-startendelem=".endDateTime1" readonly>

    <p>End DateTime : </p>
    <input class="endDateTime1" type="text" data-field="datetime" data-startend="end" data-startendelem=".startDateTime1" readonly>

    var thisDate = myFunction();
    $("#dtBox").DateTimePicker({
        dateTimeFormat: "dd-MM-yyyy hh:mm:ss AA",
        maxDateTime: moment(thisDate).add(30, 'minutes').format("D-MM-YYYY hh:mm:ss A"),
        minDateTime: moment(thisDate).format("D-MM-YYYY hh:mm:ss A"),
        animationDuration: 100
    });

nehakadam avatar May 25 '16 17:05 nehakadam