Fastest Web Hosting

how can i set break in jquery loop

0 votes
asked Dec 17, 2016 in PHP by anonymous
for(var i=0;i < len;i++)
				{
					var event_date=events_array[i];
					var next_event_date = new Date(event_date);
					var n_last_event = new Date(last_event);

					if(next_event_date > n_last_event)
					{

						var p_month = n_last_event.getMonth();
						for(var d =n_last_event;d <= next_event_date; d.setDate(d.getDate() + 1))
						{

							var a_month =d.getMonth();
							if(p_month != a_month)
							{
							p_month = a_month;
							var for_new_month = a_month+1;
							var for_year =d.getFullYear();
							
							var lastDay = new Date(next_event_date.getFullYear(), next_event_date.getMonth() + 1, 0);
							var lastDayWithformat =  lastDay.getFullYear() + "-" + (addLeadingZero(lastDay.getMonth() + 1)) +"-"+ (addLeadingZero(lastDay.getDate()));

							var FirstDay = new Date(next_event_date.getFullYear(), next_event_date.getMonth(), 1);
							var FirstDayWithformat =  FirstDay.getFullYear() + "-" + (addLeadingZero(FirstDay.getMonth() + 1)) +"-"+ (addLeadingZero(FirstDay.getDate()));

							$("#shown_first_event").val(FirstDayWithformat);
							$("#shown_last_event").val(lastDayWithformat);

						
							$(".responsive-calendar").responsiveCalendar(for_year+'-'+for_new_month);
							}
						}
						break //want to exit from current loop
					}
				}

Your answer

Preview

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

Job Board

TechnicalSharp is a technical community of developers where they are sharing their knowledge and solutions and against it they are getting the score point which help them to make profile strong which is under eyes on MNC's
...