Yii Framework Forum: Free Form Calendar Application - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Free Form Calendar Application Usable for Yii framework, other frameworks or free standing PHP

#21 User is offline   JimDanDee 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 21-September 09

Posted 30 September 2009 - 08:08 PM

View Postjim, on 24 September 2009 - 07:56 PM, said:

First time I've tried posting so hope it works. I think the day of the month issue is caused by this code.
 
/* We need to take the month value and turn it into one without a leading 0 */
         if((substr($this->month, 0, 1)) == 0)
         {
             // if value is between 01 - 09, drop the 0
             $tempMonth = substr($this->month, 2); //The 2 should be 1 if you want the second character.
             $this->month = $tempMonth;
         }

I didn't try it so its not tested.


That was it. Thank you!
Jim
0

#22 User is offline   whoopass 

  • Advanced Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 119
  • Joined: 27-May 09
  • Location:Ajax, Ontario, Canada

Posted 30 September 2009 - 08:26 PM

View PostJimDanDee, on 30 September 2009 - 08:08 PM, said:

That was it. Thank you!
Jim


Just out of curiosity, what did you changed. I'll investigate and update all the posts and applications for it :)

Thanks for the debugging guys ;)
0

#23 User is offline   jim 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 01-February 09
  • Location:Winnipeg,Mb Canada

Posted 01 October 2009 - 07:29 PM

View Postwhoopass, on 30 September 2009 - 08:26 PM, said:

Just out of curiosity, what did you changed. I'll investigate and update all the posts and applications for it :)

Thanks for the debugging guys ;)

Change
$tempMonth = substr($this->month, 2);
To
$tempMonth = substr($this->month, 1);
0

#24 User is offline   WaCkYbOb 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 04-January 10

  Posted 04 January 2010 - 06:16 PM

OK EVERYONE!!
i am making this calendar for just plain php, and i noticed some of you are good with colors and styling!
i have the calendar working and stuff... hopefully.
i just need 2 color schemes, and wanted to know if someone could make them for me...
ok so i need a blueish color scheme(its going on a site that uses blues), and a pastel color scheme(my boss/webmaster said pastels go well with the scheme for the site, im just a worker). it would be great if someone could make one or both.

THANK YOU ALL!!!!... in advance

and just some colors that are used on the site:
#97c4e3
#00ffff
#33ffcc

i can get more, but thats just a few.
0

#25 User is offline   eupher 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 05-January 10

Posted 05 January 2010 - 11:22 PM

View Postwhoopass, on 20 August 2009 - 03:43 AM, said:



Thanks for posting this class. It has been a real time saver for a project I'm working on. I'll preface my question by letting you know that I'm very much a novice at this, but if anyone can help with the bug(?) I'm seeing, I'd greatly appreciate it.

I noticed when using this class on my own site, that if you display a month (such at July 2010) that has the last day of the month on a Saturday, that there is an extra (blank) row added to the table. I tried it at the demo site listed above and witnessed the same behavior. I've looked at the logic that is drawing the table and can't figure out what is causing the problem. Anyone have any ideas?

Thanks again.
0

#26 User is offline   Luciano 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 143
  • Joined: 20-September 09
  • Location:Buenos Aires, Argentina

Posted 13 June 2010 - 10:09 AM

Works sweet! Thanks for this!
Just added some modifications and it fits my needs...

One thing filling the empty days in the last row:
         
         /* finish the rest of the days in the week */
         if($days_in_this_week < 8) :
             for($x = 1; $x <= (8 - $days_in_this_week); $x++):
                 $this->calendar.= '<td class="'. $this->style .'-day-np">&nbsp;</td>';
             endfor;
         endif;


if $days_in_this_week equals 1 (i.e. 2010 July) you get a complete empty last row, maybe it's not what you really want, so change to this and voila:

         /* finish the rest of the days in the week */
         if($days_in_this_week < 8 && $days_in_this_week > 1) : // <--- here
             for($x = 1; $x <= (8 - $days_in_this_week); $x++):
                 $this->calendar.= '<td class="'. $this->style .'-day-np">&nbsp;</td>';
             endfor;
         endif;


And it would be nice if I could start the week on monday. I suck in PHP dates, so if anyone have a clue it would be great.

Thanks again!
Company web site: pressEnter

Free as in "beer"...
0

#27 User is offline   demos 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 08-September 10

Posted 08 September 2010 - 02:08 PM

this code is great but can someone please make include the getting of events in the database like on david walsh calendar tut.. i tried but i failed dunno what to do.. thanks in advance..
btw i use mysql and php...thanks
0

#28 User is offline   phosItc 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 12-August 11
  • Location:Cambodia

Posted 14 August 2011 - 10:31 PM

hi all! I'm a new using yii framework. I don't know how to use jquery with yii framework like calendar and popup box. hope all of you will help me.. :)
0

#29 User is offline   KFJ1972 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 23-February 12
  • Location:Copenhagen, Denmark

Posted 23 February 2012 - 05:01 PM

Is there a easy way in the script to translate the name of the months to other languages as there was for the week days ?
0

#30 User is offline   Dyno Dan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 26-November 12

Posted 26 November 2012 - 11:54 PM

I know this whole post is kind of old, but my small contribution to this would be this:

Wouldn't changing these two lines of code to use $_REQUEST be much shorter?
$month = (isset($_POST['month'])) ? $_POST['month'] : $_GET['month'];
$year = (isset($_POST['year'])) ? $_POST['year'] : $_GET['year'];

The result would be this...
$month = $_REQUEST['month'];
$year = $_REQUEST['year'];
0

#31 User is offline   Dyno Dan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 26-November 12

Posted 27 November 2012 - 12:17 AM

One more thing to comment on is this piece of code:

/* We need to take the month value and turn it into one without a leading 0 */
if((substr($this->month, 0, 1)) == 0)
{
// if value is between 01 - 09, drop the 0
$tempMonth = substr($this->month, 1);
$this->month = $tempMonth;
}

Why would you not just change how you define $this->month earlier in the code?

You have:
$this->month = date("m");

Why not use:
$this->month = date("n");

"m" is the numeric representation of the month with the leading zero. "n" is the numeric representation of the month WITHOUT the leading zero.

Making this change would take out some of the overhead in the code.
0

#32 User is offline   Shyam Prasath 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 05-February 14

Posted 11 February 2014 - 08:05 AM

Could anyone tell me how to get the date value in the place where we list the events in calender

/** You can query the database for an entry for this day if you like or print out a message on each day.Uncomment these two lines.  **/
                                
$this->calendar.= '<div class="'. $this->style .'-text"><a href="">'.$date.'</a></div><br/><br/>';
$this->calendar.= str_repeat('<p> </p>',2);


I wanna get the date value in this block and by which i have to get the event list from the database.
0

#33 User is offline   smallpenn 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 17-February 13

Posted 26 March 2014 - 04:15 AM

Hi, i facing trouble to view out the calender,I follow the steps,i place the class on component, i put the controller on the site controller and view file on the site/. But seem outcome is undefined variable:month on which the error from the site controller
$calendar=new Calendar($month,$year,$style);

I hope someone can help out.I worry i miss out any steps.
0

#34 User is offline   segen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 25-November 14

Posted 25 November 2014 - 02:55 AM

Hi. I'm new to yii and PHP. I'm trying to use this event calendar in a yii1.1 project.
I added the class as an yii component.
It gives me the following PHP notice.
Undefined variable: style
in the following line:
$this->calendar.= '<tr class="'. $style .'-row">';

If I don't use &style, it works fine. The calendar is displayed without css styles.
Please help me to identify the problem.
Thank you.
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users