How to implement a simple calendar on php7 using AJAX'a?

Gentlemen developers, beginners and experienced. PHP help-the homeless.

Help to understand how to write a simple script counting days in the month and the conclusion of most of these days to the page in the form close to that to which we are accustomed. And how you can implement pogrugenie months when you click for example on 'next'button?

How to think about this algorithm?
What a start?

I would be grateful for any information!
bb5b7ab652644533b2bd4f703ab690fe.jpg
July 2nd 19 at 18:11
2 answers
July 2nd 19 at 18:13
Solution
In PHP out of the box is a powerful parser date:

php.net/manual/ru/datetime.formats.php

So you can write this:

new \DateTime('first monday of this month'); // 2016-11-07
new \DateTime('first sunday of November 2016'); // 2016-11-06


same with dates manipulation, comparison, etc.

And how you can implement pogrugenie months when you click for example on 'next'button?


Be consistent. First print the calendar for this month. Then make it so that we could watch the calendar for any month of any year. Then googling how to do http requests in javascript.

p.s. such things are easier to do entirely on the client. Not to mention the fact that it is better to take an existing calendar.
July 2nd 19 at 18:15
THE IMPLEMENTATION OF MY CALENDAR IN JS
Can help (good luck to understand)

https://jsfiddle.net/ckx34moL/

Find more questions by tags AJAXPHP