Java Christmas Day Check isChristmas()

Here you can find the source of isChristmas()

Description

is Christmas

License

LGPL

Declaration

public static boolean isChristmas() 

Method Source Code

//package com.java2s;
//License from project: LGPL 

import java.util.Calendar;

public class Main {
    private static boolean isSetup = false;
    private static Calendar calendar;

    public static boolean isChristmas() { // Ho ho ho
        doSetup();/*w ww  . j a v  a 2  s.  co  m*/

        return calendar.get(Calendar.MONTH) == Calendar.DECEMBER
                && calendar.get(Calendar.DAY_OF_MONTH) == 25;
    }

    private static void doSetup() {
        if (!isSetup) {
            calendar = Calendar.getInstance();
            calendar.setTimeInMillis(System.currentTimeMillis());
        }
    }
}

Related

  1. isChristmas()
  2. isChristmas()
  3. isChristmas()
  4. isChristmas()