Skip to content

Commit

Permalink
working in nepali timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
nirabpudasaini committed Sep 6, 2017
1 parent 953127a commit 75f6919
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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});
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 75f6919

Please sign in to comment.