A plugin to convert AD to BS and vice versa. There is also Nepali Date Picker.
For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.
Create instance using NepaliDate.fromAd([dateTime])
DateTime dateTime = DateTime(2019,1,1);
NepaliDate bsDate = NepaliDate.fromAD(dateTime);
print(bsDate.toString()); // 2075 - 9 - 17
You can also access individual year day month as
bsDate.year
, bsDate.month
, bsDate.day
Create instance using NepaliDate.fromBS(year, month, day)
NepaliDate nepaliDate = NepaliDate.fromBS(2076,1,1);
print("${nepaliDate.dateTime.year} - ${nepaliDate.dateTime.month} - ${nepaliDate.dateTime.day}")
// 2019 - 4 - 14
NepaliDatePicker(context, currentDate: pickedNepaliDate,
onSelected: (nepalidate) {
print(nepalidate);
}).showDatePicker();