Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Calendar;
import android.content.Context;
import android.text.format.DateUtils;

public class Main {
    public static String formatMediumDate(Context context, Calendar date) {
        return getAbbrevDayOfWeekString(date.get(Calendar.DAY_OF_WEEK)) + ", "
                + DateUtils.formatDateTime(context, date.getTimeInMillis(), DateUtils.FORMAT_NUMERIC_DATE);
    }

    public static String getAbbrevDayOfWeekString(Calendar date) {
        return getAbbrevDayOfWeekString(date.get(Calendar.DAY_OF_WEEK));
    }

    public static String getAbbrevDayOfWeekString(int day) {
        return DateUtils.getDayOfWeekString(day, DateUtils.LENGTH_MEDIUM);
    }
}