Date

Date

The namespace for all UF/Object utility functions, typically for static methods.

Source:

Members

(static) all_months :Array.<string>

Source:
Type:

(static) bc_leap_years :Array.<number>

Source:
Type:

(static) months :Object

Source:
Type:

Methods

(static) convertStringToDate(arg0_date_string, arg1_delimiteropt) → {Object|undefined}

Converts a given string to a Date object if possible.

Source:
Parameters:
Name Type Attributes Default Description
arg0_date_string string
arg1_delimiter <optional>
"."
Returns:
Type:
Object | undefined

(static) convertTimestampToDate(arg0_timestamp) → {Object|*}

Converts a timestamp to a Date object.

Source:
Parameters:
Name Type Description
arg0_timestamp number | string
Returns:
Type:
Object | *

(static) convertTimestampToInt(arg0_timestamp) → {number}

Converts a timestamp to an integer if possible.

Source:
Parameters:
Name Type Description
arg0_timestamp number | string
Returns:
Type:
number

(static) fromDate(arg0_date) → {Object}

Returns a UF Date object from a proper Date object.

Source:
Parameters:
Name Type Description
arg0_date
Returns:
Type:
Object

(static) getBlankDate() → {Object}

Returns a blank date template starting at '0AD'.

Source:
Returns:
Type:
Object

(static) getCurrentDate() → {Object}

Returns the present Date.

Source:
Returns:
Type:
Object

(static) getDate(arg0_date) → {Date}

Returns a Date object from a variable type.

Source:
Parameters:
Name Type Description
arg0_date Date | Object | number | string
Returns:
Type:
Date

(static) getDaysAgo(arg0_date) → {number}

The number of days ago a Date was from the present timestamp.

Source:
Parameters:
Name Type Description
arg0_date Date | any
Returns:
Type:
number

(static) getDaysInMonths(arg0_date_object) → {number}

Returns the number of days in the .months value within a Date object.

Source:
Parameters:
Name Type Description
arg0_date_object Object
Returns:
Type:
number

(static) getHoursAgo(arg0_date) → {number}

The number of seconds ago a Date was from the present timestamp.

Source:
Parameters:
Name Type Description
arg0_date Date | any
Returns:
Type:
number

(static) getLeapYearsBefore(arg0_year) → {number}

Fetches the number of leap years before a certain year.

Source:
Parameters:
Name Type Description
arg0_year number
Returns:
Type:
number

(static) getLeapYearsBetween(arg0_start_year, arg1_end_year) → {number}

Fetches the number of leap years between two years.

Source:
Parameters:
Name Type Description
arg0_start_year number | string
arg1_end_year number | string
Returns:
Type:
number

(static) getMillisecondsAgo(arg0_date) → {number}

The number of milliseconds ago a Date was from the present timestamp.

Source:
Parameters:
Name Type Description
arg0_date Date | any
Returns:
Type:
number

(static) getMinutesAgo(arg0_date) → {number}

The number of seconds ago a Date was from the present timestamp.

Source:
Parameters:
Name Type Description
arg0_date Date | any
Returns:
Type:
number

(static) getModernTimestamp(arg0_date) → {number}

Returns the modern timestamp (UNIX-based) for a given date.

Source:
Parameters:
Name Type Description
arg0_date Date | any
Returns:
Type:
number

(static) getMonth(arg0_month_name) → {number}

Fetches the month index from its name.

Source:
Parameters:
Name Type Description
arg0_month_name string
Returns:
Type:
number

(static) getMonthsFromDays(arg0_date_object) → {number}

Returns the number of months from the number of .day within the date object.

Source:
Parameters:
Name Type Description
arg0_date_object Object
Returns:
Type:
number

(static) getSecondsAgo(arg0_date) → {number}

The number of seconds ago a Date was from the present timestamp.

Source:
Parameters:
Name Type Description
arg0_date Date | any
Returns:
Type:
number

(static) getTimestamp(arg0_date_object) → {number}

Returns a numeric timestamp from a specific Date object. Number of minutes from 1 January, 00:00 on 1AD.

Source:
Parameters:
Name Type Description
arg0_date_object Object
Returns:
Type:
number

(static) isLeapYear(arg0_year) → {boolean}

Whether the given year is a leap year.

Source:
Parameters:
Name Type Description
arg0_year number
Returns:
Type:
boolean

(static) parseYears(arg0_years) → {Object}

Parses a float number of years into a specific Date object.

Source:
Parameters:
Name Type Description
arg0_years number
Returns:
Type:
Object