Im working on a school website where the client would like a global date that is the start and finish of all the classes. This part is easy as I have made a Global where you enter the Start and End dates for the semester. At the moment this is just a text field.
The next challenge is to make it add days onto the start and end date depending on what day a class starts on. So for example: If I say the week starts on a Monday and set the starting date to the 20/10/2015. If the class is also on a Monday it will not change the date. But if the class is a Tuesday it will add +1 to the date making the starting date the 21st. (Wednesday +2, Thursday +3, Friday +4, Saturday, +5, Sunday +6) This would be easy except that if the day goes above how many days there are in a month. for example if the starting date is 28/10/2015 on Friday it would list as 32/10/2015 but would need to be changed to the 01/11/2015.
Does anyone know of a way that I can write this? Would using the date field make this easier?