Support calendars less than a year long
See original GitHub issueI’d like to show a range of dates, ex. 3 months, without showing the entire calendar year. I see that you can use the from
and to
to specify the year that you want, but I’d like to only show the dates starting and ending on the from
and to
dates.
Perhaps a prop to opt in / out of this behavior?
Happy to help with a PR if you agree. THANK YOU for all of your hard work, this is an amazing library!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:24
- Comments:29 (12 by maintainers)
Top Results From Across the Web
2023 Calendars
Find your perfect 2023 calendar showing months for the year 2023. View the 2023 calendars online. Wall calendars. Mini-wall Calendars. Planners.
Read more >Common Calendar Sizes For Printing - Which Standard To Use?
It's best to use various sizes of calendars at home to help with the daily schedule. A long year-round calendar poster gives you...
Read more >Create a calendar - Microsoft Support
(In Publisher 2010, click Calendars under Most Popular.) ... one year per calendar page (to change the month that the calendar starts on,...
Read more >Calendar Year Meaning vs. Fiscal Year, Pros & Cons
A tax year is the 12-month calendar period covered by a taxpayer's annual tax return. ... A short tax year is a fiscal...
Read more >Create a recurring event - Android - Google Calendar Help
Under the time, tap More options and then Does not repeat. ... Tip: Repeating events in Google Calendar have a limit of 730...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Having granularity of months would be awesome and should solve most use cases smaller than a year that involve a calendar specifically.
Proposal: Use a prop
granularity
that is either"month"
or"year"
with a default of"year"
for existing compatibility. This is slightly more flexible than a boolean propshowMonths
or something because it allows for future iteration on the string values without changing the API. I would be happy to change the name of the prop, not feeling creative at the moment.Is that the correct understanding? Where in the last example we would show the entire month of April, not just the first week of April?
Hi, guys. I finished implementing this on my fork.
The proposed solution by @kristiehowboutdat:
<Calendar from="02-01-2018" to="05-01-2018" granularity="month" monthBorderColor="purple" monthBorderWidth={4} />
would give us this:
I went a step further and added the following:
This way we can achieve a n (n from 1 until
breakpoint
) months/years per direction and choose the week layout to render. For example:<Calendar from="01-01-2020" to="12-31-2020" direction="horizontal" granularity="month" weekDirection="horizontal" monthSpacing={20} yearSpacing={30} breakpoint={3} monthBorderWidth={0}/>
Produces:
As you can notice, this results in some
year
properties having a weird name because they now refer to blocks.Also, I can’t submit a PR yet because the code base is the one from #1040.
So, feel free to revise both codes and do comments and changes to improve it (lacks website and api documentation, for example) Cya