We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f799ab commit e8df343Copy full SHA for e8df343
src/utils.ts
@@ -233,11 +233,9 @@ export const getMonthLabel = (startDate: string): string => {
233
const start = new Date(startDate);
234
const now = new Date();
235
236
- const currentMonthStart = new Date(now.getFullYear(), now.getMonth(), 1);
237
const inputMonthStart = new Date(start.getFullYear(), start.getMonth(), 1);
238
239
- const diffTime = currentMonthStart.getTime() - inputMonthStart.getTime();
240
- const diffMonths = Math.floor(diffTime / (30 * 24 * 60 * 60 * 1000));
+ const diffMonths = (now.getFullYear() - start.getFullYear()) * 12 + (now.getMonth() - start.getMonth());
241
242
if (diffMonths === 0) {
243
return "this month";
0 commit comments