kevinsqi / react-calendar-heatmap

An svg calendar heatmap inspired by github's contribution graph
http://www.kevinqi.com/react-calendar-heatmap/
MIT License
1.23k stars 156 forks source link

Change startDate and endDate default values #123

Open cyclops24 opened 4 years ago

cyclops24 commented 4 years ago

Hi @kevinsqi Thanks for this awesome project. I think it's better to set startDate to the first day of the current year and endDate to the last day of current day as a default value. Now it's set to: (Really why 200? :thinking: )

startDate: dateNDaysAgo(200),
endDate: new Date(),

And I think it's not a good default value. If you agree I can add this as a PR. Just let me know :wink:

kevinsqi commented 4 years ago

Yeah, I totally agree that 200 days ago is a bad default value. Honestly, it was so long ago that I don't remember the rationale behind it 😅. I'm not sure that setting the default to be the beginning of the year is ideal either, though, because that's sort of arbitrary too. I'm thinking startDate and endDate should default to the earliest and latest date values in props.values instead. What do you think of that?

sampathBlam commented 4 years ago

@kevinsqi : If we use props.values to identify the start and the end date, what would happen if no value is passed by the user in the props.values attribute? We will anyway need a default date, won't we?

Deveshb15 commented 3 years ago

@kevinsqi can't I go beyond 200 days, I want to showcase the graph for a whole year?