V
V
Vlad Tokarev2017-05-15 12:15:59
PHP
Vlad Tokarev, 2017-05-15 12:15:59

What should be the logic of a calendar with repeating dates?

What should be the logic of the calendar, in which events can have duration, repeatability (once a day, week, month, on weekdays/weekends, every 2nd Wednesday of the month, every 1st Monday of the year), exclusions from repeatability (work on weekdays, but excluding holidays), etc.?
How in the presented logic to make a selection, say, 5 nearest events?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xtala zen, 2017-05-15
@xtala

class logic. Assign classes to days of interest. The classes have the required properties. If you need to add any properties to a specific day, add the appropriate class. For example, we want to exclude May 23, 2017 from repetition, then we simply add a class to it, for example .exception to which the appropriate parameters are already set.


How in the presented logic to make a selection, say, 5 nearest events?
And how is the selection in the data array done? A calendar is a two-dimensional array of data, well, or a table in a simple way.
The loop loops through the elements of the array and displays the elements with the required class or classes.

B
Boris Korobkov, 2017-05-15
@BorisKorobkov

See how others do it interface-wise. For example, https://calendar.google.com/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question