Here you can find the source of getWeekendDays(Locale locale)
private static int[] getWeekendDays(Locale locale)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010-2015 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from w ww . j a v a2s . co m*/ * BSI Business Systems Integration AG - initial API and implementation ******************************************************************************/ import java.util.Arrays; import java.util.Calendar; import java.util.List; import java.util.Locale; public class Main { private static final List<String> SUN_WEEKEND_DAYS_COUNTRIES = Arrays .asList(new String[] { "GQ", "IN", "TH", "UG" }); private static final List<String> FRY_WEEKEND_DAYS_COUNTRIES = Arrays.asList(new String[] { "DJ", "IR" }); private static final List<String> FRY_SUN_WEEKEND_DAYS_COUNTRIES = Arrays.asList(new String[] { "BN" }); private static final List<String> THU_FRY_WEEKEND_DAYS_COUNTRIES = Arrays.asList(new String[] { "AF" }); private static final List<String> FRY_SAT_WEEKEND_DAYS_COUNTRIES = Arrays.asList(new String[] { "AE", "DZ", "BH", "BD", "EG", "IQ", "IL", "JO", "KW", "LY", "MV", "MR", "OM", "PS", "QA", "SA", "SD", "SY", "YE" }); private static int[] getWeekendDays(Locale locale) { if (THU_FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[] { Calendar.THURSDAY, Calendar.FRIDAY }; } else if (FRY_SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[] { Calendar.FRIDAY, Calendar.SUNDAY }; } else if (FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[] { Calendar.FRIDAY }; } else if (SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[] { Calendar.SUNDAY }; } else if (FRY_SAT_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[] { Calendar.FRIDAY, Calendar.SATURDAY }; } else { return new int[] { Calendar.SATURDAY, Calendar.SUNDAY }; } } }