Week numbers

Use the showWeekNumbers prop to display a column with the weeks numbers.

Code


import React from 'react';
import DayPicker from 'react-day-picker';
import 'react-day-picker/lib/style.css';

export default function Example() {
  return (
    <DayPicker
      showWeekNumbers
      onWeekClick={(week, days) => console.log(week, days)}
    />
  );
}

Result


December 2017
Su
Mo
Tu
We
Th
Fr
Sa
47
1
2
48
3
4
5
6
7
8
9
49
10
11
12
13
14
15
16
50
17
18
19
20
21
22
23
51
24
25
26
27
28
29
30
52
31