@Html.TextBoxFor(model => model.TicketBeginTime, Model.TicketBeginTime.ToString("yyyy/MM/dd"), new { @class = "textbox", style = "150px;", onfocus = "ticketBeginTime()" })
@Html.TextBoxFor(model => model.TicketEndTime, Model.TicketEndTime.ToString("yyyy/MM/dd"), new { @class = "textbox", style = "150px;", onfocus = "ticketEndTime()" })
function saleBegintime() {
WdatePicker({dateFmt:'yyyy/MM/dd',maxDate:'#F{$dp.$D(\'SaleEndTime\',\'TicketBeginTime\',{d:-0});}'});
}
function saleEndTime() {
WdatePicker({ dateFmt: 'yyyy/MM/dd', minDate: '#F{$dp.$D(\'SaleBeginTime\',{d:-0});}'});
}
function ticketBeginTime() {
WdatePicker({ dateFmt: 'yyyy/MM/dd', minDate: '#F{$dp.$D(\'SaleBeginTime\',{d:0});}', maxDate: '#F{$dp.$D(\'TicketEndTime\',{d:-1});}' });
}
function ticketEndTime() {
var strDate1 = $("#SaleEndTime").val();
var strDate2 = $("#TicketBeginTime").val();
var date1 = Date.parse(strDate1);
var date2 = Date.parse(strDate2);
if (($("#SaleEndTime").val()) > ($("#TicketBeginTime").val())) {
WdatePicker({ dateFmt: 'yyyy/MM/dd', minDate: '#F{$dp.$D(\'SaleEndTime\',{d:3});}' });
}
else {
if ((date2 - date1) / (60 * 60 * 1000) <= 24) {
WdatePicker({ dateFmt: 'yyyy/MM/dd', minDate: '#F{$dp.$D(\'SaleEndTime\',{d:3});}' });
}
if ((date2 - date1) / (60 * 60 * 1000) <= 48) {
WdatePicker({ dateFmt: 'yyyy/MM/dd', minDate: '#F{$dp.$D(\'SaleEndTime\',{d:3});}' });
} else {
WdatePicker({ dateFmt: 'yyyy/MM/dd', minDate: '#F{$dp.$D(\'TicketBeginTime\',{d:1});}' });
}
}
}