API/libsapojs/SAPO/Utility/Date

Version 1 (modified by tiago.c.rodrigues, 3 years ago)

here be robots

[Elements] are optional

Class SAPO.Utility.Date


class SAPO.Utility.Date
Class to provide the same features that php date does
Defined in Utility/Date/0.1/lib.js

Function Summary
private Number _daysInMonth (Number _m, Number _y)
Function that returns the number of days of a given month (m) on a given year (y)
String _months (Number index)
Function that returns the string representation of the month [PT only]
String _wDays (Number index)
Function that returns the representation the day of the week [PT Only]
String get ( format, _date)
Functions that works exactly as php date() function - works like PHP 5.2.2 PHP Date function

Function Details

function _daysInMonth

private Number _daysInMonth(Number _m, Number _y)
Function that returns the number of days of a given month (m) on a given year (y)
Parameters:
_m - month
_y - year
Returns:
the number of days

function _months

String _months(Number index)
Function that returns the string representation of the month [PT only]
Parameters:
index - month javascript (0 to 11)
Returns:
the month name

function _wDays

String _wDays(Number index)
Function that returns the representation the day of the week [PT Only]
Parameters:
index - day of the week in javascript 0 to 6
Returns:
the week day description

function get

String get( format, _date)
Functions that works exactly as php date() function - works like PHP 5.2.2 PHP Date function
Parameters:
format - as the string in which the date it will be formatted - mandatory
_date - the date to format. If undefined it will do it on now() date. Can receive unix timestamp or a date object
Returns:
the date formatted