get day of programmer by using Russia Julian Calendar * 256th day of the pr

29 阅读1分钟

programmer _20250627180527.png

/**
     * dayOfProgrammer
     * American time machine test on the Russia Calendar
     * return 256th day of programmer day
     * exists two type calendar
     * Julian Calendar
     * Gregorian Calendar
     * output
     * that day by using simple date format dd.mm.yyy
     * constriants:
     * 1700<=year<=2700
     * 1918 year is a special year
     * the 32th day January is February 14th this year and this month is beging with 14th day
     * from 1700 to 1917 using Julian Calendar
     * from 1919 to 2700 using Gregorian Calendar
     *
     * @param year
     * @return
     */
    public static String dayOfProgrammer(int year) {
        if (year < 1700 || year > 2700) {
            return null;
        }
//        if ()
        return null;
    }

    /**
     * get day of programmer by using Russia Julian Calendar
     * 256th day of the programmer input year
     * output data format: dd.mm.yyyy
     * 儒略历从三月March到一月January,
     * 各月的天数依次为31、30、31、30、31、30、31、30、31、30、31;
     * 二月February的天数为平年29、闰年30,四年一闰
     * @param year
     * @return
     */
    public static String dayOfProgrammerJulian(int year) {
        if(!checkIsJulianYear(year)){
            return null;
        }
        //

        return null;
    }
/**
 * check year if is leap year
 *
 * @param year
 * @return
 */
public static Boolean checkIsLeapYear(int year) {
    if (year < 1700 || year > 2700) {
        return null;
    }
    if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {
        return true;
    }
    return false;
}

/**
 * check year if it is Russia Julian Calendar
 *
 * @param year
 * @return
 */
public static Boolean checkIsJulianYear(int year) {
    if (year < 1700 || year > 2700) {
        return null;
    }
    if (year >= 1700 && year <= 1917) {
        return true;
    }
    return false;
}

/**
 * check year if it is Russia Greborian Calendar
 *
 * @param year
 * @return
 */
public static Boolean checkIsGregorianYear(int year) {
    if (year < 1700 || year > 2700) {
        return null;
    }
    if (year > 1918 && year <= 2700) {
        return true;
    }
    return false;
}

/**
 * check year if it is Russia special transmition year
 *
 * @param year
 * @return
 */
public static Boolean checkIsRussiaSpecialTransitionYear(int year) {
    if (year < 1700 || year > 2700) {
        return null;
    }
    if (year == 1918) {
        return true;
    }
    return false;
}