﻿function AddDateRangePicker(startElementId, stopElementId) {
    var dates = $('#' + startElementId + ', #' + stopElementId).datepicker({
        showOn: "both",
        buttonImage: '/Images/calendar.gif',
        buttonImageOnly: true,
        onSelect: function (selectedDate) {
            var option = this.id == startElementId ? "minDate" : "maxDate";
            dates.not(this).datepicker("option", option, selectedDate);
        }
    });
};

function AddDatePicker(elementId) {
    var dates = $('#' + elementId).datepicker({
        showOn: "both",
        buttonImage: '/Images/calendar.gif',
        buttonImageOnly: true,
    });
};

function CustomValidator_ValidDate(sender, args) {
    if (document.getElementById(sender.controltovalidate).value.match(new RegExp(/^\d{1,2}\.\d{1,2}\.\d{4}$/))) {
        args.IsValid = true;
    } else {
        args.IsValid = false;
    }
}

