Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choose Weekend days #13

Closed
asrma7 opened this issue Nov 13, 2018 · 2 comments
Closed

Choose Weekend days #13

asrma7 opened this issue Nov 13, 2018 · 2 comments
Labels

Comments

@asrma7
Copy link

asrma7 commented Nov 13, 2018

Version of flutter_calendar_carousel

1.1.9

Expected behavior

able to choose which days of the week is weekend
for example: in my country only saturday is the weekend day but the plugin has both sat and sun as the weekend

Actual behavior

Both saturday and sunday are marked as weekend

Steps to reproduce the behavior

a option to change the current weekend days

@hyochan
Copy link
Member

hyochan commented Nov 13, 2018

@asrma7 Yeah. good point. This is an easy feature so I just quickly added this. You can now do this with weekends attribute in 1.1.10.

weekends: [WeekDay.Sunday, WeekDay.Saturday],

@asrma7
Copy link
Author

asrma7 commented Nov 14, 2018

@dooboolab

One more feature request

How about adding a holidays attribute that takes a list of DateTime and displays those days in weekend color. This can be very helpful in adding public holidays. I did this by editing the library code. You can introduce this feature in new update too

implementation

//define list:
  final List<DateTime> holidays;

//define bool test as you did for isToday and isSelectedDay
bool isHoliday = widget.holidays != null &&
                      widget.holidays.contains(DateTime(
                          year, month, index + 1 - this._startWeekday));

//check if it is a holiday
style: (index % 7 == 0 || index % 7 == 6 || isHoliday) &&

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants