Closed saileshkush95 closed 4 years ago
There is no straight forward solution for this problem from this library. But there is a way around how you can construct calendar on your own by fetching data from NepaliDate
.
What you can do on your views is, for eg you want the calendar for Ashar 2077
,
NepaliDate
for first day of Ashar 2077
by
from nepali_date import NepaliDate
first_day_month = NepaliDate(2077, 3, 1)
2. Next find total days in that month. You can do that by
```python
total_days_month = NepaliDate.calendar_data[2077][3-1]
first_day_month.weekday
So from your views you can pass like first day in the month and total days in the month, like for this case the first day is Mon
and total days in the month is 31
to your calendar template. So based on these two values you can apply some looping logic and display the calendar.
I hope this helps. Thank you.
Sorry for this question, I know this is not a good platform for asking question. Actually I want to build a calendar using django same as below. .
I've no idea, how to achieve this one. So can you please share some idea, or guide , that can help me to achieve this. and the last question is how can i use this package in my project. Please give me some idea, I wan't to learn some things in this lock down period.
I'm using django, and python default HTML Calendar modules and here is my progress.