Android Open Source - commit-android Commit Helper






From Project

Back to project page commit-android.

License

The source code is released under:

GNU General Public License

If you think the Android project commit-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.mauriciogiordano.commit;
/*from  w ww .  ja v a  2  s.co  m*/
import java.util.Calendar;
import java.util.TimeZone;

public class CommitHelper
{

  public static Long getToday()
  {
    Calendar today = Calendar.getInstance();
    today.setTimeZone(TimeZone.getDefault());
    
    today.set(Calendar.SECOND, 0);
    today.set(Calendar.MINUTE, 0);
    today.set(Calendar.HOUR_OF_DAY, 1);
    today.set(Calendar.MILLISECOND, 0);
    
    // FOR DEBUG
    //today.set(Calendar.DAY_OF_YEAR, today.get(Calendar.DAY_OF_YEAR) + 1);
    
    return today.getTimeInMillis();
  }
  
  public static Long getYesterday()
  {
    Calendar yesterday = Calendar.getInstance();
    yesterday.setTimeZone(TimeZone.getDefault());
    
    yesterday.set(Calendar.SECOND, 0);
    yesterday.set(Calendar.MINUTE, 0);
    yesterday.set(Calendar.HOUR_OF_DAY, 1);
    yesterday.set(Calendar.MILLISECOND, 0);
    
    int day = yesterday.get(Calendar.DAY_OF_YEAR);
    
    yesterday.set(Calendar.DAY_OF_YEAR, day - 1);
    
    return yesterday.getTimeInMillis();
  }
  
}




Java Source Code List

com.mauriciogiordano.commit.CommitActivity.java
com.mauriciogiordano.commit.CommitAlarmIntent.java
com.mauriciogiordano.commit.CommitAlarmReceiver.java
com.mauriciogiordano.commit.CommitHelper.java
com.mauriciogiordano.commit.Constants.java
com.mauriciogiordano.commit.adapter.CommitAdapter.java
com.mauriciogiordano.commit.database.BaseModel.java
com.mauriciogiordano.commit.database.Commit.java
com.mauriciogiordano.commit.database.Commitment.java
com.mauriciogiordano.commit.database.DatabaseConfigUtil.java
com.mauriciogiordano.commit.database.DatabaseHelper.java
com.mauriciogiordano.commit.fragment.CommitFragment.java
com.mauriciogiordano.commit.fragment.CommitmentsFragment.java
com.mauriciogiordano.commit.view.CommitButton.java
com.mauriciogiordano.commit.view.CommitEditText.java
com.mauriciogiordano.commit.view.CommitTextView.java