diff --git a/src/main/java/np/com/nirab/nepalideveloperutils/BSCalender/NepaliDate.java b/src/main/java/np/com/nirab/nepalideveloperutils/BSCalender/NepaliDate.java index dc3dd3b..5e7d942 100644 --- a/src/main/java/np/com/nirab/nepalideveloperutils/BSCalender/NepaliDate.java +++ b/src/main/java/np/com/nirab/nepalideveloperutils/BSCalender/NepaliDate.java @@ -3,6 +3,7 @@ import android.content.Context; import org.joda.time.DateTime; +import org.joda.time.DateTimeZone; import org.joda.time.Days; import java.util.Date; @@ -38,7 +39,6 @@ public NepaliDate(Context c, int enYear, int enMonth, int enDay){ } - public void init(DateTime date){ daysInMonths.put(2000, new int[]{30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31}); daysInMonths.put(2001, new int[]{31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30}); @@ -133,6 +133,8 @@ public void init(DateTime date){ daysInMonths.put(2090, new int[]{30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30}); DateTime base = new DateTime(1944,1,1,0,0); + date = date.withZone(DateTimeZone.forID("Asia/Kathmandu")); + long daysBetween = Days.daysBetween(base,date).getDays(); int nepaliYear = 2000;