Android Open Source - Calendar-DayView Utility






From Project

Back to project page Calendar-DayView.

License

The source code is released under:

Apache License

If you think the Android project Calendar-DayView 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.srikanthgr.calendarweekview.utility;
/*from   ww w. j a v a 2s  . c o  m*/
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Srikanth G.R
 *
 */
public class Utility {

  private static final String DATE_TIME_FORMAT = "yyyy/MM/dd";
  private static final String DATE_TIME_FORMAT_MILLI = "dd/MM/yyyy";
  private static final String DATE_TIME_FORMAT_AM_PM = "HH:mm aa";

  public static String getDateTimeStr(String p_time_in_millis) {
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_TIME_FORMAT_MILLI);
    Date l_time = new Date(Long.parseLong(p_time_in_millis));
    return sdf.format(l_time);
  }

  public static Long getMilliSeconds(String date) throws ParseException {
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_TIME_FORMAT);
    Date date1 = sdf.parse(date);
    System.out.println(date1.getTime());
    return date1.getTime();
  }

  public static String startTimeEndTime(String startTime) {
    SimpleDateFormat sdfrr = new SimpleDateFormat(DATE_TIME_FORMAT_AM_PM);
    Date l_time = new Date(Long.parseLong(startTime));
    String time = sdfrr.format(l_time);
    return time;

  }
}




Java Source Code List

com.srikanthgr.calendarweekview.MainActivity.java
com.srikanthgr.calendarweekview.datainterface.DataInterface.java
com.srikanthgr.calendarweekview.fragments.DayFragment.java
com.srikanthgr.calendarweekview.listeners.TabsListener.java
com.srikanthgr.calendarweekview.model.Event.java
com.srikanthgr.calendarweekview.utility.Utility.java