Calculation of days of one month

Asked

Viewed 171 times

-1

I’m setting up a schedule and I’m going to do a calendar. I need to know how many days are there in the month and also what day of the week is the first of each month. How to do this with PHP?

  • I found these examples half finished: http://davidwalsh.name/php-calendar http://www.php-calendar.org/

  • fullCalendar is a very good lib, simple and with good documentation.

  • I changed the question, I think it’s easier to answer now!!! I expect more answers...

  • Why did you use jQuery and Javascript tags?

2 answers

4

That may not completely answer your question, but I once used the library Full Calendar for dates and worked very well.

It is a jQuery library of a Google Calendar-style interface, all with drag-and-drop, has a demo of what can be done to her.

To process data generated by type callback functions:

$('#calendar').fullCalendar({ 
  dayClick: function() {
    alert('a day has been clicked!'); 
    } 
});

-1

Based on a template they posted I created this simple calendar:

<?php 
    $month = 8;
    $year = 2014;
    $days_in_month = date('t',mktime(0,0,0,$month,1,$year));

    for($list_day = 1; $list_day <= $days_in_month; $list_day++):
    echo "<div id=\"calendario_dia\">$list_day</div>";
    endfor;
?>

It needs to be modified to be "usable", it’s just the base I needed!!!

  • I believe this is an answer to which the user arrived alone. If this is the case, it would be better to mark it as certain.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.