Java Code Examples for java.util.Calendar.getMinimalDaysInFirstWeek()

The following are Jave code examples for showing how to use getMinimalDaysInFirstWeek() of the java.util.Calendar class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: jdk8u-jdk   File: Bug4518811.java   View Source Code Vote up 6 votes
static int getDays(String lang, String loc){
    int errors=0;
    Locale newlocale = new Locale(lang, loc);

    Calendar newCal = Calendar.getInstance(newlocale);

    int minDays = newCal.getMinimalDaysInFirstWeek();
    System.out.println("The Min Days in First Week for "+ lang +"_" + loc + " is " + minDays);

    if (minDays != 4){
        System.out.println("Warning! Should be 4, not " + minDays +"!");
        errors++;
    }
    return errors;
}
 
Example 2
Project: openjdk-jdk10   File: Bug4518811.java   View Source Code Vote up 6 votes
static int getDays(String lang, String loc){
    int errors=0;
    Locale newlocale = new Locale(lang, loc);

    Calendar newCal = Calendar.getInstance(newlocale);

    int minDays = newCal.getMinimalDaysInFirstWeek();
    System.out.println("The Min Days in First Week for "+ lang +"_" + loc + " is " + minDays);

    if (minDays != 4){
        System.out.println("Warning! Should be 4, not " + minDays +"!");
        errors++;
    }
    return errors;
}