get two week date

Hi
First of all many thanks to all. You guys are done a wonderful job. Recently i tried your scheduler with symfony 1.4 [PHP freamwork]. I have a few problem with that.

Following are my problem.
1 - How to prevent the past repetation days. In my case suppose i am start the event at 8th Jan then
it should not start from 3rd Jan.

2 - Is there any function to get two diffrent week dates. In my case is 1st Jan to 5th Jan event date.

If possible please give me an example.

sorry for bad english. :frowning:

Thanks in advance.


How to prevent the past repetation days. In my case suppose i am start the event at 8th Jan then it should not start from 3rd Jan.

Can you provide some more details, which repetition mode you have selected
Normally recurring event starts from start-date which is specified in time-selector, but for some recurring mode it can be auto-shifted to start of month

Is there any function to get two diffrent week dates
Do you need to get some info about current view ( start, end dates of visible range?
docs.dhtmlx.com/doku.php?id=dhtm … r_getstate
or dates of recurring event
docs.dhtmlx.com/doku.php?id=dhtm … r_getstate

Hi Stanislav,
Thanks for your replay. I will explain my problem.
In the calender if i double click on 8th Jan a pop up window open and i set the repetation criteria for my event but when i save the event it should not start with 3rd Jan (i.e. In database start should be 8th Jan.) and previous day should not display me an event. I tried same thing in google calender and it’s give me perfect result. Please see in attached image.

Please give me solution for my second problem. In that i want to get the event date from 8th Jan to 11th Jan. which is two diffrent week date. Is there any function to give me such kind of result. I wrote a function in PHP which give me perfect result if i am on 8th Jan (i.e. on Saturday) but when i am on 9th Jan (i.e. Sunday ) it give me only a sunday date that is 9th Jan.
here my function

/**
 * @todo Execute getEventDate function to check date  based upon given parameter.
 * 
 * @param $snEnd_date integer value set end_date of event
 * @param $ssRce_patern	string value like 	week_1___4,5#
 * return array of dates
 */
public static function getEventDate($snEnd_date,$ssRcePatern)
{
	$ssRepDay= str_replace("no","",$ssRcePatern);
	$saRepDay=split("_", str_replace("#","",$ssRepDay));
	
	$saDate=array();
	
	if($saRepDay[0]=='week' || $saRepDay[0]=='day') //code for event repeat week or day.
	{	
		if($saRepDay[4] || $saRepDay[4]==0) //Check $saRepDay[4] days like 0 to 6
		{
			$saEventDayName=split(",", $saRepDay[4]);
			//echo "<pre>"; print_r($saEventDayName); 
			
			if($saEventDayName || $saEventDayName[0] == 0)
			{	

				for($snD=0;$snD<count($saEventDayName);$snD++)
				{ 
					//echo $snD;
					//$snTodate=date("Y-m-d" ,strtotime("2011-01-01"));
					//$snDaymy=date ("w",strtotime("2011-01-01"));
					$snTodate=date("Y-m-d");
					$snDaymy=date ("w");
					/*Check EventDayName and  Todate day name is equal or  not*/
					
					//echo $saEventDayName[$snD]; echo "<br/>";
					if($saEventDayName[$snD]==$snDaymy)
					{
						/*Check array key is 0 in $saEventDayName */
						if($snD==0)
						{
							for($snCH=$snD;$snCH<(count($saEventDayName));$snCH++)
							{
								if(count($saEventDayName)!=1)
								{
									if( $saEventDayName[0] == 0 && $saEventDayName[1] == 6 )
									{
										if($saEventDayName[$snCH]==0)
											 $snCDate=date("Y-m-d",strtotime('- 1 days',strtotime($snTodate)));						
										if($saEventDayName[$snCH]==6)
											 $snCDate=date("Y-m-d",strtotime('+ 0 days',strtotime($snTodate)));															
									}
									else
									{
										
										if($snCH != (count($saEventDayName)-1))
										{ 
											if(($saEventDayName[$snCH+1]-$saEventDayName[$snCH])>1)
											{ 
												$snCDate=date("Y-m-d",strtotime('+'.($snCH).'  days',strtotime($snTodate)));						
												if($snCDate>=$snEnd_date)
													break;
												else
													$saDate[]=$snCDate;
												break;
											}
											else
												 $snCDate=date("Y-m-d",strtotime('+'.($snCH).'days',strtotime($snTodate)));						
										}
										else
										{
											 $snCDate=date("Y-m-d",strtotime('+'.($snCH).'days',strtotime($snTodate)));						
										}
									}
								}
								else
								{
										$snCDate=date("Y-m-d",strtotime('+'.($snCH).'days',strtotime($snTodate)));	
								}	
								if($snCDate>=$snEnd_date)
									break;
								else
									$saDate[]=$snCDate;
								
							}
						}
						/*Check array key is not 0 in $saEventDayName */
						 
						if($snD!=0)
						{  
							if($saEventDayName[0]!=0 && $saEventDayName[1]!=6)
							{
								//check any date lessthan today date
								if($saEventDayName[$snD-1]<$snDaymy)
								{ 
									for($snLD=$snD;$snLD>0;$snLD--)
									{	
										/*check $saEventDayName[1] and $saEventDayName[0] between gaps or not*/
										 $snLDay=(($saEventDayName[1]-$saEventDayName[0])>1)?$snLD-1:$snLD;
										if(($saEventDayName[$snLD]-$saEventDayName[$snLD-1])>1)
										{	
												break;
										}
										else
										{ 
										 $snLDate=(!isset($snLDate))?date("Y-m-d",strtotime('-'.$snLDay.' days',strtotime($snTodate))):$snLDate=date("Y-m-d",strtotime('+ 1 days',strtotime($snLDate)));
											/*check $snLDate greater end_date*/
											if($snLDate>=$snEnd_date)
												break;
											else
												$saDate[]=$snLDate;
										}
									}
								}
							}
							else
							{
								//check any date lessthan today date
								if($saEventDayName[$snD-1] < $snDaymy)
								{
									for( $snLD=$snD; $snLD>0; $snLD-- )
									{	
										//check $saEventDayName[1] and $saEventDayName[0] between gaps or not
										
										$snLDay = (($saEventDayName[1]-$saEventDayName[0])>1) ? $snLD-1 : $snLD; 
										
										if(($saEventDayName[$snLD]-$saEventDayName[$snLD-1])>1)
										{	
											break;
											//echo "Here";
										}
										else
										{ 
										 	$snLDate=(!isset($snLDate))?date("Y-m-d",strtotime('-'.$snLDay.' days',strtotime($snTodate))):$snLDate=date("Y-m-d",strtotime('+ 1 days',strtotime($snLDate)));
											//check $snLDate greater end_date.
											if($snLDate>=$snEnd_date)
												break;
											else
												$saDate[]=$snLDate;
										}
									}
								}
								
							}
							// END HERE
							
							if($saEventDayName[0]==0 && $saEventDayName[1]==6)
							{	
								if($saEventDayName[0]==0)
								{ 
									$snSSDate=date("Y-m-d",strtotime('+ 0 days',strtotime($snTodate)));
									$saDate[]=$snSSDate;
								}
								if($saEventDayName[1]==6 )
								{	
									$snSSDate=date("Y-m-d",strtotime('+ 1 days',strtotime($snSSDate)));
									$saDate[]=$snSSDate;
								}	

							}
							else
							{ 
								//check any date equal today date
								if($saEventDayName[$snD]==$snDaymy)
									 $saDate[]=$snTodate;
							}
							
							/*check $saEventDayName is last element or not*/				
							if($snD != (count($saEventDayName)-1))
							{ 
								/*check any date Greater today date*/
								if($saEventDayName[$snD+1]>$snDaymy)
								{ 
									for($snLD=$snD;$snLD<(count($saEventDayName)-1);$snLD++)
									{
										/*check gap between two todate*/
										if(($saEventDayName[$snLD+1]-$saEventDayName[$snLD])>1)
											break;
										else
										{
											$snGDate=(!isset($snGDate)) ? date("Y-m-d",strtotime('+ 1 days',strtotime($snTodate))) : date("Y-m-d",strtotime('+ 1 days',strtotime($snGDate)));
											/*Check $snGDate is greater end_date*/
											if($snGDate>=$snEnd_date)
												break;
											else
												$saDate[]=$snGDate; 
										}
									}
								}
							}
						}
					}
				}
			}
			
			//echo "<pre>"; print_r($saDate);
			return $saDate;
		}
	}
	/*code for event repeat month or year*/
	if($saRepDay[0]=='month'||$saRepDay[0]=='year')
	{	
		 $saDate[]=date("Y-m-d");
			
		return $saDate;
	}
} // Function End.

Please give me solution for my second problem its urgent.

Once again Tanks for your replay.
Thanks


as for new event - you can create event which starts on jan-8 and end on jan-18, after that in recurring section set “daily”, “each 2 days”

which will result in exatly same view as on above screen
rec type will be day_2___#3, with start and end dates pointing to the jan-8 and jan-18

Hi
Thanks for your help. I will reexplain my problem.

I want to create an event which is repeat a 4 day in a week say Saturday, Sunday, Monday and Tuesday. Suppose i start my event from 8th Jan to 31st Jan. then it should not start from 3rd Jan. In database event start date should be 8th Jan. My repetition mode is weekly. I create a same event in Google Calender in that it start from 8th Jan not from 3rd Jan. So basically they give me an event start date from 8th Jan. The same thing i want to apply in my scheduler can you please help me. Any example will be preferable.

And one more question. I want to place a text editor instade of a text box in popup how can i do that.

Thanks in advace.

Problem with weekly recurring days mode confirmed. Current design doesn’t allow to create recurring event with such pattern.

And one more question. I want to place a text editor instade of a text box in popup how can i do that.

You can create a custom form section, or replace lightbox with custom html form.
docs.dhtmlx.com/doku.php?id=dhtm … tails_form