Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2013
    Posts
    16
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Bug with Jquery DateTimePicker

    Hi

    I am using the datetimepicker from here http://trentrichardson.com/examples/timepicker/

    I am using the - Restrict a start and end date (also shows using onSelect and onClose events) code.

    The thing is, the first time ( both date and time ) are selected at both textboxes, it works fine,
    If I change the value by selecting the calendar again, the TIME value dissappears, has anyone encountered this problem.

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    3,020
    Thanks
    56
    Thanked 566 Times in 563 Posts
    I don't see that happening on the example page. Is it browser-specific? What does your error console say?

  • #3
    New Coder
    Join Date
    Mar 2013
    Posts
    16
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Hi

    http://forums.asp.net/t/1611771.aspx/1 - my question is also asked here

    I think its related to "after postback" the values goes missing, returning asp.net error, I have come through several solutions, but nothing works. It something similar to this, what is the best solution, this is my datetimepicker code, which I modified from the trent richard thingy, I created a mask for time and date.Even with using the original code and with the autopostback enabled, I still get the same error.

    Code:
    $(function pageLoad() 
        {
    
            var startDateTextBox = $('#fromtime');
            var endDateTextBox = $('#endtime');
    
            startDateTextBox.datetimepicker
        ({
            dateFormat: 'dd/mm/yy',
            timeFormat: 'hh:mm tt',
            onClose: function (dateText, inst) {
                if (endDateTextBox.val() != '') {
                    var testStartDate = startDateTextBox.datetimepicker('getDate');
                    var testEndDate = endDateTextBox.datetimepicker('getDate');
                    if (testStartDate > testEndDate)
                        endDateTextBox.datetimepicker('setDate', testStartDate);
                }
                else {
                    endDateTextBox.val(dateText);
                }
            },
            onSelect: function (selectedDateTime) {
                endDateTextBox.datetimepicker('option', 'minDate', startDateTextBox.datetimepicker('getDate'));
            }
        });
    
            endDateTextBox.datetimepicker
        ({
            dateFormat: ('dd/mm/yy'),
            timeFormat: 'hh:mm tt',
    
            onClose: function (dateText, inst) {
                if (startDateTextBox.val() != '') {
                    var testStartDate = startDateTextBox.datetimepicker('getDate');
    
                    var testEndDate = endDateTextBox.datetimepicker('getDate');
    
                    if (testStartDate > testEndDate)
                        startDateTextBox.datetimepicker('setDate', testEndDate);
                }
                else {
                    startDateTextBox.val(dateText);
                }
            },
            onSelect: function (selectedDateTime) {
                startDateTextBox.datetimepicker('option', 'maxDate', endDateTextBox.datetimepicker('getDate'));
            }
        });
        });

  • #4
    New Coder
    Join Date
    Mar 2013
    Posts
    16
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Hi,
    I even tried this link
    http://weblogs.asp.net/hajan/archive...functions.aspx

    yet, it does not work.


  •  

    Posting Permissions

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