android.text.format.Time#EPOCH_JULIAN_DAY源码实例Demo

下面列出了android.text.format.Time#EPOCH_JULIAN_DAY 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: narrate-android   文件: Utils.java
/**
 * Returns the week since {@link Time#EPOCH_JULIAN_DAY} (Jan 1, 1970)
 * adjusted for first day of week.
 *
 * This takes a julian day and the week start day and calculates which
 * week since {@link Time#EPOCH_JULIAN_DAY} that day occurs in, starting
 * at 0. *Do not* use this to compute the ISO week number for the year.
 *
 * @param julianDay The julian day to calculate the week number for
 * @param firstDayOfWeek Which week day is the first day of the week,
 *          see {@link Time#SUNDAY}
 * @return Weeks since the epoch
 */
public static int getWeeksSinceEpochFromJulianDay(int julianDay, int firstDayOfWeek) {
    int diff = Time.THURSDAY - firstDayOfWeek;
    if (diff < 0) {
        diff += 7;
    }
    int refDay = Time.EPOCH_JULIAN_DAY - diff;
    return (julianDay - refDay) / 7;
}
 
源代码2 项目: ClockPlus   文件: Utils.java
/**
 * Returns the week since {@link Time#EPOCH_JULIAN_DAY} (Jan 1, 1970)
 * adjusted for first day of week.
 *
 * This takes a julian day and the week start day and calculates which
 * week since {@link Time#EPOCH_JULIAN_DAY} that day occurs in, starting
 * at 0. *Do not* use this to compute the ISO week number for the year.
 *
 * @param julianDay The julian day to calculate the week number for
 * @param firstDayOfWeek Which week day is the first day of the week,
 *          see {@link Time#SUNDAY}
 * @return Weeks since the epoch
 */
public static int getWeeksSinceEpochFromJulianDay(int julianDay, int firstDayOfWeek) {
    int diff = Time.THURSDAY - firstDayOfWeek;
    if (diff < 0) {
        diff += 7;
    }
    int refDay = Time.EPOCH_JULIAN_DAY - diff;
    return (julianDay - refDay) / 7;
}
 
源代码3 项目: BottomSheetPickers   文件: Utils.java
/**
 * Returns the week since {@link Time#EPOCH_JULIAN_DAY} (Jan 1, 1970)
 * adjusted for first day of week.
 *
 * This takes a julian day and the week start day and calculates which
 * week since {@link Time#EPOCH_JULIAN_DAY} that day occurs in, starting
 * at 0. *Do not* use this to compute the ISO week number for the year.
 *
 * @param julianDay The julian day to calculate the week number for
 * @param firstDayOfWeek Which week day is the first day of the week,
 *          see {@link Time#SUNDAY}
 * @return Weeks since the epoch
 */
public static int getWeeksSinceEpochFromJulianDay(int julianDay, int firstDayOfWeek) {
    int diff = Time.THURSDAY - firstDayOfWeek;
    if (diff < 0) {
        diff += 7;
    }
    int refDay = Time.EPOCH_JULIAN_DAY - diff;
    return (julianDay - refDay) / 7;
}
 
源代码4 项目: Android-RecurrencePicker   文件: Utils.java
/**
 * Returns the week since {@link android.text.format.Time#EPOCH_JULIAN_DAY} (Jan 1, 1970)
 * adjusted for first day of week.
 * <p/>
 * This takes a julian day and the week start day and calculates which
 * week since {@link android.text.format.Time#EPOCH_JULIAN_DAY} that day occurs in, starting
 * at 0. *Do not* use this to compute the ISO week number for the year.
 *
 * @param julianDay      The julian day to calculate the week number for
 * @param firstDayOfWeek Which week day is the first day of the week,
 *                       see {@link android.text.format.Time#SUNDAY}
 * @return Weeks since the epoch
 */
public static int getWeeksSinceEpochFromJulianDay(int julianDay, int firstDayOfWeek) {
    int diff = Time.THURSDAY - firstDayOfWeek;
    if (diff < 0) {
        diff += 7;
    }
    int refDay = Time.EPOCH_JULIAN_DAY - diff;
    return (julianDay - refDay) / 7;
}
 
源代码5 项目: DateTimepicker   文件: Utils.java
/**
 * Returns the week since {@link Time#EPOCH_JULIAN_DAY} (Jan 1, 1970)
 * adjusted for first day of week.
 *
 * This takes a julian day and the week start day and calculates which
 * week since {@link Time#EPOCH_JULIAN_DAY} that day occurs in, starting
 * at 0. *Do not* use this to compute the ISO week number for the year.
 *
 * @param julianDay The julian day to calculate the week number for
 * @param firstDayOfWeek Which week day is the first day of the week,
 *          see {@link Time#SUNDAY}
 * @return Weeks since the epoch
 */
public static int getWeeksSinceEpochFromJulianDay(int julianDay, int firstDayOfWeek) {
    int diff = Time.THURSDAY - firstDayOfWeek;
    if (diff < 0) {
        diff += 7;
    }
    int refDay = Time.EPOCH_JULIAN_DAY - diff;
    return (julianDay - refDay) / 7;
}
 
源代码6 项目: StyleableDateTimePicker   文件: Utils.java
/**
 * Returns the week since {@link Time#EPOCH_JULIAN_DAY} (Jan 1, 1970)
 * adjusted for first day of week.
 *
 * This takes a julian day and the week start day and calculates which
 * week since {@link Time#EPOCH_JULIAN_DAY} that day occurs in, starting
 * at 0. *Do not* use this to compute the ISO week number for the year.
 *
 * @param julianDay The julian day to calculate the week number for
 * @param firstDayOfWeek Which week day is the first day of the week,
 *          see {@link Time#SUNDAY}
 * @return Weeks since the epoch
 */
public static int getWeeksSinceEpochFromJulianDay(int julianDay, int firstDayOfWeek) {
    int diff = Time.THURSDAY - firstDayOfWeek;
    if (diff < 0) {
        diff += 7;
    }
    int refDay = Time.EPOCH_JULIAN_DAY - diff;
    return (julianDay - refDay) / 7;
}
 
源代码7 项目: cathode   文件: Utils.java
/**
 * Returns the week since {@link Time#EPOCH_JULIAN_DAY} (Jan 1, 1970)
 * adjusted for first day of week.
 *
 * This takes a julian day and the week start day and calculates which
 * week since {@link Time#EPOCH_JULIAN_DAY} that day occurs in, starting
 * at 0. *Do not* use this to compute the ISO week number for the year.
 *
 * @param julianDay The julian day to calculate the week number for
 * @param firstDayOfWeek Which week day is the first day of the week,
 *          see {@link Time#SUNDAY}
 * @return Weeks since the epoch
 */
public static int getWeeksSinceEpochFromJulianDay(int julianDay, int firstDayOfWeek) {
    int diff = Time.THURSDAY - firstDayOfWeek;
    if (diff < 0) {
        diff += 7;
    }
    int refDay = Time.EPOCH_JULIAN_DAY - diff;
    return (julianDay - refDay) / 7;
}