sarbagyastha / nepali_date_picker

Material Style Date Picker with Bikram Sambat(Nepali) Calendar Support. Supports both Android and ios.
BSD 3-Clause "New" or "Revised" License
40 stars 30 forks source link

Date Conversion Issue #27

Open rajSapkota26 opened 5 months ago

rajSapkota26 commented 5 months ago

date not converted properly

here is sample code final DateTime? picked = await showDatePicker( context: context, initialDate:DateTime.now(), firstDate: DateTime(2010), lastDate: DateTime(2100), );

          final nep=  picked!.toNepaliDateTime();
          final d=  NepaliDateTime.now();

          log("date eng-----------  $picked");
          log("date nep from eng--- $picked --- $nep");
          log("date nep library------$d");
          log("date eng from nep-----${d.toDateTime()}");

-----------------------here is output------------------------- [log] date eng----------- 2024-04-28 00:00:00.000 [log] date nep from eng--- 2024-04-28 00:00:00.000 --- 2081-01-17 00:00:00.000 [log] date nep library------2081-01-17 23:35:15.052654 [log] date eng from nep-----2024-04-29 23:35:15.052654

------------------issue-------------------- when 2024-04-28 convert it show 2081-01-17 , it should be 2081-01-16 when 2081-01-17 convert it show 2024-04-29, here it work fine in converter but todays date here 2081-01-16 why it give tomorrow date in NepaliDateTime.now();

Bidhanrai commented 3 months ago

Same issue for me