Add save variable to main.json
#83 ski-sassin offhand pole should match 2nd-best regular offhand
Merge pull request #81 from Sinza-/develop

Add save variable to main.json
Custom Day Start: change condition on when we run cron

This is an attempt to fix some of the problems people have with custom
day start, especially those in #1570.

I believe this is a bug in when we decide to run cron. Right now we look
for the difference between startOfDay(user.lastCron) and now to be
greater than 0.

For the following cases, let today be January 8th and yesterday be January 7th.

Consider the scenario where `dayStart = 0` and the `lastCron` is sometime yesterday.

`lastCron.start('days').add('d', dayStart)` will just be January 7th at midnight. Then
the difference will be greater than 0 anytime after midnight on January
8th. Works as expected.

However, consider the case where `dayStart` is set to something greater than
0, like 3. Now let's say the user logs on after midnight on January 8th
but before their Custom Day Start (something common in many reports),
and cron is run

`lasCron.start('days').add('d', dayStart)` will be January 8th at
3am. Therefore the difference won't be greater than 0 until January 9th
at 3am and their dailys, etc won't become unchecked.

Therefore, this commit adds two extra conditions to check when daysMissed
is equal to zero:

  * cronBeforeStart: Was the last cron run before the Custom Day Start
    time for today's date?
  * nowAfterStart: Have we passed the Current Day Start time for today's
    date?

I believe that both of these condition must be true OR daysMissed must
be greater than zero to run cron. Please, please, please double and
triple check my logic here. I don't want to make this any more of a
mess, because working with times makes my brain hurt.