Java Calendar Create getCalendar()

Here you can find the source of getCalendar()

Description

Creates a calendar instance configured for french dates (local, timezone, start day of week and minimal days for first week in year are configured correctly).

License

Open Source License

Declaration

public static Calendar getCalendar() 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * This file is part of ISPyB./*  w  ww .j a va 2s.  c  o  m*/
 * 
 * ISPyB is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * ISPyB is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with ISPyB.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Contributors : S. Delageniere, R. Leal, L. Launer, K. Levik, S. Veyrier, P. Brenchereau, M. Bodin, A. De Maria Antolinos
 ******************************************************************************/

import java.util.Calendar;

import java.util.Locale;
import java.util.TimeZone;

public class Main {
    /**
     * Creates a calendar instance configured for french dates (local, timezone, start day of week and minimal days for
     * first week in year are configured correctly).
     * 
     * @return
     */
    public static Calendar getCalendar() {
        Calendar cal = Calendar.getInstance(
                TimeZone.getTimeZone("Europe/Paris"), Locale.FRANCE);
        cal.setFirstDayOfWeek(Calendar.MONDAY);
        // the first thursday in a year defines the first week
        cal.setMinimalDaysInFirstWeek(4);
        return cal;
    }
}

Related

  1. getCalendar()
  2. getCalendar()
  3. getCalendar()
  4. getCalendar()
  5. getCalendar()
  6. getCalendar()
  7. getCalendar()
  8. getCalendar()
  9. getCalendar(boolean skipConversion)