kfiross / flutter_holo_date_picker

A Flutter package of datepicker like Holo Theme in Android
MIT License
61 stars 77 forks source link

How can we add year value to show the year according to my country? #45

Open SittiphanSittisak opened 2 years ago

SittiphanSittisak commented 2 years ago

My year is an additional 543 years from the year by A.D. I already set the locale property to my country(TH). I see the dateFormat property config this but can't add 543 years.

I can set the initialDate property by DateTime(DateTime.now().year + 543) but it is not correct. February have 28 days and 29 days every 4 years. For the example: A.D. 2020 => 29 days in TH we add 543: 2563 => 29 days if I use DateTime(DateTime.now().year + 543), it will wrong: A.D. 2020 => 29 days TH 2563 => 28 days //2564 => 29 days

My project saves date time with A.D. and shows with year + 543. How to add years or shows the custom year?

I need it.

SittiphanSittisak commented 2 years ago

Now, I need to edit this image at C:\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_holo_date_picker-1.0.3\lib\date_time_formatter.dart

Can you add the property for this? I need it.

SittiphanSittisak commented 2 years ago

It will be better to add properties like: yearDisplay: String Function(int)? monthDisplay: String Function(int)? dayDisplay: String Function(int)?

These will make this package can display data independently.

kfiross commented 2 years ago

@SittiphanSittisak I will change it to TH locale ONLY soon

kfiross commented 2 years ago

@SittiphanSittisak can you check the branch feature/BE?

SittiphanSittisak commented 1 year ago

Sorry for replying late. I checked this. This is correct. Thank you very much.

SittiphanSittisak commented 1 year ago

@kfiross can you deploy this in production?

I saw https://github.com/kfiross/flutter_holo_date_picker/commit/f13f2b360148190336b6d7f3b9e974eb8904ec8e How do I use this version?