So this sounds easy, just take the day and date in java and see if it's the same day using the system's time with the calendar. This I can do and this would be a question that's probably repeated multiple times on here.
But my question is how to get like Cyber Monday. Let's say I have a program and every year on Cyber Monday he needs to lower the prices in the shop by 70% or set the discount to 70%. (which is actually my goal) Should I use java calendar for it? Which I can I guess. But how should I do it? I can't just check for the day we are now is the same as 27-11-2017 because in 2018 it's not on 27-11-2018. So how should I calculate this or check for it?
Is it possible to use like a API which has annual events and where people can send a request to receive the date of the requested annual event? Like I noticed the google calendar API but this is only for calendars you made yourself. Which I'm not planning to add every annual event for my own.
I made this method, To check if it's CyberMonday, what it's main purpose is. At this moment I'm stuck doing it annually. How can I make this right for every year?
public static void CyberMonday() {
//Check here if it's Cybermonday or if it's day after cybermonday.
if(Server.getCalendar().getYMD().toString().equals("2017/11/27") ) {
Config.CYBER_MONDAY = true;
updateCyberMondayOnWebsite();
} else {
Config.CYBER_MONDAY = false;
}
}