Class: TimeDate

timapi.TimeDate()

Time and Date class.

Overview

Members-Overview

Methods-Overview

Constructor

new TimeDate()

Create TimeDate with zero-date

Member-List

day :Number

Day of the month - [1,31].

hour :Number

Hour since midnight - [0,23].

minute :Number

Minute after the hour - [0,59].

month :Number

Month since January - [0,11].

second :Number

Second after the minute - [0,59].

year :Number

Year since 0.

Methods

toDate() → {Date}

Returns a JavaScript Date object.
Returns:
Date object

Type: Date

toString() → {String}

Get string representation for debugging purpose.
Returns:
String representation

Type: String

toStringReceiptDate() → {String}

Format as "ddMMyyyy" string for receipts.
Returns:
Date as string.

Type: String

toStringReceiptTime() → {String}

Format as "HHmmss" string for receipts.
Returns:
Time as string.

Type: String

toStringRegular() → {String}

Format as "ddMMyyyy HHmmss" string.
Returns:
Datetime as string suitable for receipts..

Type: String

(static) copy(timeDate) → {timapi.TimeDate}

Creates a copy of an timapi.TimeDate object.
Parameters:
Name Type Description
timeDate timapi.TimeDate Original
Returns:
Copy of original

Type: timapi.TimeDate

(static) fromDate(date) → {timapi.TimeDate}

Creates instance of timapi.TimeDate from JavaScript Date
Parameters:
Name Type Description
date Date Javascript Date object
Returns:
Created instance of timapi.TimeDate

Type: timapi.TimeDate

(static) fromNow() → {timapi.TimeDate}

Creates instance of timapi.TimeDate with timestamp of the current moment
Returns:
Created instance of timapi.TimeDate

Type: timapi.TimeDate