Skip to content

Instantly share code, notes, and snippets.

@jongravois
Created January 6, 2018 11:08
Show Gist options
  • Save jongravois/54ac3921736bd189d3e6716b158e0233 to your computer and use it in GitHub Desktop.
Save jongravois/54ac3921736bd189d3e6716b158e0233 to your computer and use it in GitHub Desktop.
bizDaysMonths: state => {
return [
{},
{
month: 'jan',
biz_days: moment('2018-01-01').monthBusinessDays().length
},
{
month: 'feb',
biz_days: moment('2018-02-01').monthBusinessDays().length
},
{
month: 'mar',
biz_days: moment('2018-03-01').monthBusinessDays().length
},
{
month: 'apr',
biz_days: moment('2018-04-01').monthBusinessDays().length
},
{
month: 'may',
biz_days: moment('2018-05-01').monthBusinessDays().length
},
{
month: 'jun',
biz_days: moment('2018-06-01').monthBusinessDays().length
},
{
month: 'jul',
biz_days: moment('2018-07-01').monthBusinessDays().length
},
{
month: 'aug',
biz_days: moment('2018-08-01').monthBusinessDays().length
},
{
month: 'sep',
biz_days: moment('2018-09-01').monthBusinessDays().length
},
{
month: 'oct',
biz_days: moment('2018-10-01').monthBusinessDays().length
},
{
month: 'nov',
biz_days: moment('2018-11-01').monthBusinessDays().length
},
{
month: 'dec',
biz_days: moment('2018-12-01').monthBusinessDays().length
}
];
},
bizDaysYear: getters => {
let bdays = getters.bizDaysMonths().map(function(i) {
return i.biz_days;
});
return bdays.reduce(function(prev, curr) {
return prev + curr;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment