Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
fix(history): fix bug with skip some first day in month
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkamyshev committed Apr 16, 2019
1 parent 517e5bb commit 062100c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const createMonthGroups = ({ from, to }: DateRange): DateGroup[] => {

let now = startOfMonth(from)
while (now < to) {
const next = addMonths(now, 1)
const next = startOfMonth(addMonths(now, 1))
const nowYear = now.getFullYear()
groups.push({
title: `${nowYear}-${getRealMonth(now)}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const createWeekGroups = ({ from, to }: DateRange): DateGroup[] => {

let now = startOfWeek(from)
while (now < to) {
const next = addWeeks(now, 1)
const next = startOfWeek(addWeeks(now, 1))
groups.push({
title: format(now, 'YYYY-MM-DD'),
from: now,
Expand Down
2 changes: 1 addition & 1 deletion front/src/features/history/helpers/createMonths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const createMonths = (from: Date, to: Date) => {

let now = wantUTC(startOfMonth)(from)
while (now < to) {
const next = wantUTC(addMonths)(now, 1)
const next = wantUTC(startOfMonth)(wantUTC(addMonths)(now, 1))
groups.push({
title: createMonthTitle(now),
from: now,
Expand Down

0 comments on commit 062100c

Please sign in to comment.