We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
date
1 parent d625a47 commit a233262Copy full SHA for a233262
src/createDateObjects.js
@@ -1,7 +1,7 @@
1
import moment from 'moment';
2
3
export default function createDateObjects(date, weekOffset = 0) {
4
- const startOfMonth = date.startOf('month');
+ const startOfMonth = moment(date).startOf('month');
5
6
let diff = startOfMonth.weekday() - weekOffset;
7
if (diff < 0) diff += 7;
0 commit comments