Here you can find the source of isMonthInRange(int month)
Parameter | Description |
---|---|
month | the value to test |
public static boolean isMonthInRange(int month)
//package com.java2s; /** DateUtils.java// ww w . j av a 2 s .co m * * Copyright 2015-2017 President and Fellows of Harvard College * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ public class Main { /** * Test to see if an integer is in the range of integers that can be months of the year. * * @param month the value to test * @return true if month is in the range 1 to 12 inclusive, false otherwise. */ public static boolean isMonthInRange(int month) { boolean result = false; if (month > 0 && month < 13) { result = true; } return result; } }