@cowboysdude said in modules day and time Depending represented:
It’s turning anything off with 'classes: ‘scheduler’, attached no matter what time you set
The expected functionality is that the module is shown between the dates specified, so once the module has done it’s thing, it hides the modules and they are not shown until the next ‘from’ date.
In more detail, it should follow the following process once it receives the notification (DOM_OBJECTS_CREATED
) that all modules have been loaded:
- It checks each module to see if it contains the ‘scheduler’ class
- If yes, it checks whether the module config includes the ‘module_scheduler’ option
- if yes, it checks whether the option includes the ‘from’ and ‘to’ properties
- if yes, it creates the cron jobs to show (‘from’) and hide (‘to’) the module
- if the next show (‘from’) date for the module is in the future and less than the next hide (‘to’) date, it hides the module
- when the ‘from’ cron job is triggered, it sends a notification to show the module
- when the ‘to’ cron job is triggered, it sends a notification to hide the module
Now, as this is work in progress I haven’t had time to check all permutations of modules and cron expressions. However, it’s logging is rather verbose so please do check out the console log (pm2 logs mm
) to see what it thinks it is doing!
If you find problems, can you post your config (or at the least, which module you are trying to schedule and the values for the module_scheduler
option?
Thanks