Click here to Skip to main content
12,506,574 members (57,650 online)

JavaScript

 
GeneralRe: Convert HTML to PDF (Client Side) Pin
J4amieC18-Dec-12 21:29
memberJ4amieC18-Dec-12 21:29 
QuestionCan't figure out why the currentSlide goes 0-3-2 Pin
jkirkerx16-Dec-12 12:08
memberjkirkerx16-Dec-12 12:08 
AnswerRe: Can't figure out why the currentSlide goes 0-3-2 Pin
jkirkerx17-Dec-12 8:40
memberjkirkerx17-Dec-12 8:40 
AnswerSo I rewrote the program from scratch, works pretty good now, feel free to build on it Pin
jkirkerx19-Dec-12 17:45
memberjkirkerx19-Dec-12 17:45 
GeneralRe: So I rewrote the program from scratch, works pretty good now, feel free to build on it Pin
Richard MacCutchan19-Dec-12 23:15
mvpRichard MacCutchan19-Dec-12 23:15 
GeneralRe: So I rewrote the program from scratch, works pretty good now, feel free to build on it Pin
jkirkerx20-Dec-12 6:18
memberjkirkerx20-Dec-12 6:18 
GeneralRe: So I rewrote the program from scratch, works pretty good now, feel free to build on it Pin
Richard MacCutchan20-Dec-12 6:39
mvpRichard MacCutchan20-Dec-12 6:39 
QuestionJava Script Pin
manoj s sherje14-Dec-12 1:05
membermanoj s sherje14-Dec-12 1:05 
QuestionRe: Java Script Pin
ProgramFOX14-Dec-12 1:33
memberProgramFOX14-Dec-12 1:33 
QuestionRe: Java Script Pin
ryanb3118-Dec-12 5:06
memberryanb3118-Dec-12 5:06 
AnswerRe: Java Script Pin
manoj s sherje19-Dec-12 1:01
membermanoj s sherje19-Dec-12 1:01 
AnswerRe: Java Script Pin
ryanb3119-Dec-12 1:37
memberryanb3119-Dec-12 1:37 
AnswerRe: Java Script Pin
vbmike19-Dec-12 4:28
membervbmike19-Dec-12 4:28 
QuestionUsing datePicker to disable dates already selected Pin
xnaLearner11-Dec-12 3:39
memberxnaLearner11-Dec-12 3:39 
hey guys..So I am using datepicker http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerStartEnd.htmlto select start and end dates.I have the controller coded so that if the user attempts to select a date from the calendar (which is already stored for them-from a previous selection) it will not add it to the DB. I also have the weekends blocked out so they cant be used (done using
http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerCustomCellRender.html)

E.g say the user has previously selected fri 14th and added it to the DB, if they try to make a new record selecting from thur 13th to mon 17th- only thur 13, and mon 17th will be added to the DB. As fri 14th was previously added and 15 and 16th are weekendsone using the following code:
[HttpPost] public ActionResult listHolidays(Holiday holiday, int? PersonId, string HolidayDate, string endDate, string AlreadyExists) 
{ DateTime startDates = Convert.ToDateTime(HolidayDate); 
DateTime endDates = Convert.ToDateTime(endDate); 
 
while (startDates <= endDates)
{
if (startDates.DayOfWeek != DayOfWeek.Saturday && startDates.DayOfWeek != DayOfWeek.Sunday)
{ 
ViewBag.CantDuplicateHolidays = String.IsNullOrEmpty(AlreadyExists) ? "date" : "";
var dates = from d in db.Holidays
where d.HolidayDate == startDates && d.PersonId == PersonId
select d;
 

// <= 0..so if it does not already exist
if (dates.Count() <= 0)
{
Holiday holiday1 = new Holiday();
holiday1.PersonId = PersonId.Value;
holiday1.HolidayDate = startDates;
 

db.Holidays.AddObject(holiday1);
db.SaveChanges();
//say start date is 10. AddDays(1) will make it 11 then return it to startDates in 'startDates' = startdates,
//but doesnt chage the value of startdates = 'startdates'
}
 

}
 

startDates = startDates.AddDays(1);
}
 

return RedirectToAction("Index");
}
---------------
my view
Date.format = 'dd/m/yyy';
$("#HolidayDate").addClass('date-pick');
$("#endDate").addClass('date-pick');
//$('.date-pick').datePicker//({dateFormat: 'dd-mm-yy'}).val();
 

// clickInput: true
 

$(function () {
//3 methods below dont allow user to select weekends
$('.date-pick').datePicker(
{
createButton: false,
renderCallback: function ($td, thisDate, month, year) {
if (thisDate.isWeekend()) {
$td.addClass('weekend');
$td.addClass('disabled');
}
 

}
}
)
 

.bind('click',
function () {
$(this).dpDisplay();
this.blur();
return false;
}
)
 

.bind('dateSelected',
function (e, selectedDate, $td) {
console.log('You selected ' + selectedDate);
}
);
 

// HolidayDate is start date
$('#HolidayDate').bind('dpClosed',
function (e, selectedDates) {
var d = selectedDates[0];
if (d) {
d = new Date(d);
$('#endDate').dpSetStartDate(d.addDays(0).asString());
}
}
);
 

//end date is end date
$('#endDate').bind('dpClosed',
function (e, selectedDates) {
var d = selectedDates[0];
if (d) {
d = new Date(d);
$('#HolidayDate').dpSetEndDate(d.addDays(0).asString());
}
}
);
});


can any suggest how to disable a date on the calendar if it is already in the DB
Questionjquery tabslideout plugin and wired behavior Pin
Tridip Bhattacharjee9-Dec-12 21:13
memberTridip Bhattacharjee9-Dec-12 21:13 
AnswerRe: jquery tabslideout plugin and wired behavior Pin
Mayor Daily17-Dec-12 4:22
memberMayor Daily17-Dec-12 4:22 
GeneralRe: jquery tabslideout plugin and wired behavior Pin
Tridip Bhattacharjee18-Dec-12 0:55
memberTridip Bhattacharjee18-Dec-12 0:55 
QuestionNeed help understanding binding Pin
Steve Bondy7-Dec-12 14:00
memberSteve Bondy7-Dec-12 14:00 
QuestionText replace Pin
rakeshs3126-Dec-12 23:06
memberrakeshs3126-Dec-12 23:06 
AnswerRe: Text replace Pin
Richard MacCutchan7-Dec-12 0:43
mvpRichard MacCutchan7-Dec-12 0:43 
GeneralRe: Text replace Pin
rakeshs3129-Dec-12 5:40
memberrakeshs3129-Dec-12 5:40 
QuestionJQuery datePicker SelectMultiple format dd/mm/yy Pin
xnaLearner6-Dec-12 0:37
memberxnaLearner6-Dec-12 0:37 
AnswerRe: JQuery datePicker SelectMultiple format dd/mm/yy Pin
srinivas nv6-Dec-12 21:50
membersrinivas nv6-Dec-12 21:50 
GeneralRe: JQuery datePicker SelectMultiple format dd/mm/yy Pin
xnaLearner10-Dec-12 0:04
memberxnaLearner10-Dec-12 0:04 
QuestionDelete selected rows by table id using javascript Pin
Member 88023075-Dec-12 8:05
memberMember 88023075-Dec-12 8:05 
AnswerRe: Delete selected rows by table id using javascript Pin
Deepak Kr15-Dec-12 18:45
memberDeepak Kr15-Dec-12 18:45 
GeneralRe: Delete selected rows by table id using javascript Pin
Member 88023076-Dec-12 6:20
memberMember 88023076-Dec-12 6:20 
AnswerRe: Delete selected rows by table id using javascript Pin
Graham Breach6-Dec-12 21:41
memberGraham Breach6-Dec-12 21:41 
QuestionHTML5 Javascript Issue Pin
John Simmons / outlaw programmer3-Dec-12 1:09
mvpJohn Simmons / outlaw programmer3-Dec-12 1:09 
AnswerRe: HTML5 Javascript Issue Pin
Graham Breach3-Dec-12 5:00
memberGraham Breach3-Dec-12 5:00 
GeneralRe: HTML5 Javascript Issue Pin
John Simmons / outlaw programmer3-Dec-12 5:22
mvpJohn Simmons / outlaw programmer3-Dec-12 5:22 
GeneralRe: HTML5 Javascript Issue Pin
Graham Breach3-Dec-12 6:29
memberGraham Breach3-Dec-12 6:29 
GeneralRe: HTML5 Javascript Issue Pin
John Simmons / outlaw programmer3-Dec-12 6:40
mvpJohn Simmons / outlaw programmer3-Dec-12 6:40 
GeneralRe: HTML5 Javascript Issue Pin
Graham Breach3-Dec-12 6:48
memberGraham Breach3-Dec-12 6:48 
GeneralRe: HTML5 Javascript Issue Pin
John Simmons / outlaw programmer3-Dec-12 9:09
mvpJohn Simmons / outlaw programmer3-Dec-12 9:09 
GeneralRe: HTML5 Javascript Issue Pin
Graham Breach3-Dec-12 11:02
memberGraham Breach3-Dec-12 11:02 
GeneralRe: HTML5 Javascript Issue Pin
John Simmons / outlaw programmer3-Dec-12 15:20
mvpJohn Simmons / outlaw programmer3-Dec-12 15:20 
GeneralRe: HTML5 Javascript Issue Pin
Media2r18-Dec-12 0:51
memberMedia2r18-Dec-12 0:51 
GeneralRe: HTML5 Javascript Issue Pin
BrainiacV18-Dec-12 3:46
memberBrainiacV18-Dec-12 3:46 
GeneralRe: HTML5 Javascript Issue Pin
John Simmons / outlaw programmer3-Dec-12 5:29
mvpJohn Simmons / outlaw programmer3-Dec-12 5:29 
GeneralRe: HTML5 Javascript Issue Pin
John Simmons / outlaw programmer4-Dec-12 1:06
mvpJohn Simmons / outlaw programmer4-Dec-12 1:06 
GeneralRe: HTML5 Javascript Issue Pin
John Simmons / outlaw programmer4-Dec-12 7:31
mvpJohn Simmons / outlaw programmer4-Dec-12 7:31 
GeneralRe: HTML5 Javascript Issue Pin
Zaf Khan19-Dec-12 20:36
memberZaf Khan19-Dec-12 20:36 
AnswerRe: HTML5 Javascript Issue Pin
Zaf Khan19-Dec-12 20:42
memberZaf Khan19-Dec-12 20:42 
QuestionCatching Exceptions in Javascript Pin
Ved Yo29-Nov-12 14:43
memberVed Yo29-Nov-12 14:43 
QuestionPartial Overlay to cover ajax request Pin
Sentenryu29-Nov-12 1:51
memberSentenryu29-Nov-12 1:51 
QuestionHow to get value from TD Pin
Chitttapa26-Nov-12 10:03
memberChitttapa26-Nov-12 10:03 
Questionhelp me please Pin
doa'a_9224-Nov-12 4:16
memberdoa'a_9224-Nov-12 4:16 
AnswerRe: help me please Pin
Leon Munir25-Nov-12 13:46
memberLeon Munir25-Nov-12 13:46 
GeneralRe: help me please Pin
J4amieC25-Nov-12 21:13
memberJ4amieC25-Nov-12 21:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.160927.1 | Last Updated 26 Sep 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid