import moment from 'moment'

export default class NextFridayProvider {
    static formattedDate() {
        return momentNextFriday().format('M/D');
    }

    static millisecondsDate() {
        return momentNextFriday().toDate().valueOf();
    }
}

const momentNextFriday = () => {
    let nextFriday = moment()
        .endOf('week')
        .subtract(1, 'day')
        .hour(15)
        .minutes(0)
        .seconds(0)
        .milliseconds(0);

    if (moment().isAfter(nextFriday)) {
        nextFriday.add(1, 'week');
    }

    return nextFriday;
};
import moment from 'moment'

export default class NextFridayProvider {
    static formattedDate() {
        return momentNextFriday().format('M/D');
    }

    static millisecondsDate() {
        return momentNextFriday().toDate().valueOf();
    }
}

const momentNextFriday = () => {
    let nextFriday = moment()
        .endOf('week')
        .subtract(1, 'day')
        .hour(14)
        .minutes(0)
        .seconds(0)
        .milliseconds(0);

    if (moment().isAfter(nextFriday)) {
        nextFriday.add(1, 'week');
    }

    return nextFriday;
};
Make alarm go off at 3pm instead of 4pm
Make alarm go off at 3pm instead of 4pm

- Moment dates are 0 indexed
