package com.i906.mpt.date;

import java.util.Calendar;
import java.util.TimeZone;

import javax.inject.Inject;
import javax.inject.Singleton;

/**
 * @author Noorzaini Ilhami
 */
@Singleton
class DateProvider {

    private final Calendar mCalendar;

    @Inject
    DateProvider() {
        mCalendar = getCalendarInstance();
    }

    private void refresh() {
        mCalendar.setTimeInMillis(getCurrentTime());
    }

    public long getCurrentTime() {
        return System.currentTimeMillis();
    }

    public Calendar getNow() {
        refresh();
        return mCalendar;
    }

    public Calendar getCalendarInstance() {
        return Calendar.getInstance(TimeZone.getTimeZone("GMT+8"));
    }
}

@@ -221,14 +221,8 @@
 ate 
-final 
 Cale
@@ -267,32 +267,68 @@
 rovider() %7B%0A    
+%7D%0A%0A    private void refresh() %7B%0A    
     mCalendar = 
@@ -351,97 +351,8 @@
 nce(
-);%0A    %7D%0A%0A    private void refresh() %7B%0A        mCalendar.setTimeInMillis(getCurrentTime()
 );%0A 

Fix random wrong month or year in prayer times