jsbeans

jsbeans  1.0.0

jsbeans > jsbeans > jsbeans.date
Search:
 
Filters

static Class jsbeans.date

A collection of utilities for date

Properties

DATE - static final Integer

Default Value: 3

HOUR - static final Integer

Default Value: 4

MILLIS - static final Integer

Default Value: 7

MINUTE - static final Integer

Default Value: 5

MONTH - static final Integer

Default Value: 2

OFFSET - static final Integer

Default Value: new Date().getTimezoneOffset() / 60

SECOND - static final Integer

Default Value: 6

YEAR - static final Integer

Default Value: 1

Methods

add

static Date add ( date , rollerType , [amount] )
Starting by a date it let you go up or down in calendar for the chosen item (year, month, ..) by the step of your choice (1 by default).
Parameters:
date <Date> a starting date
rollerType <Integer> use jsbeans.date.YEAR, jsbeans.date.MONTH, jsbeans.date.DATE, ...
[amount] <Integer> how much to roll. May be negative. Default 1
Returns: Date
a new date that differs from date in rollerType by amount

getDaysInMonth

static Integer getDaysInMonth ( date )
Returns how many days has the month in given {@param} date
Parameters:
date <Date>
Returns: Integer

isLeapYear

static boolean isLeapYear ( object )
Formula taken from Wikipedia.
If {@param} object is an Integer it will be treated as year.
Parameters:
object <Date | Integer>
Returns: boolean


Copyright © 2016 Francesco Mele. All rights reserved.