Class: PartTime

Defined in: node_modules\parttime\parttime.coffee

Overview

Creates a "PartTime" instance that represents a single moment in time with placeholder that is useful for compareing repeating moment. Currently, PartTime objects does not support timezones.

Property Summary

(Integer) year
such as 2014
(Integer) month
1-12 (not 0-11)
(Integer) date
1-31
(Integer) hour
0-24
(Integer) minute
0-59
(Integer) second
0-59
(Integer) millisecond
0-999

Class Method Summary

Instance Method Summary

Class Method Details

. (Hash) parse(timeString)

Note: This is not instance method but static method.

get parttime data from parttime string

Parameters:

  • timeString ( String ) String value representing a parttime. The string should be in a format yyyy-mm-ddT00:00:00.000.

Returns:

  • ( Hash ) — Hash data representing parttime.

Constructor Details

# (void) constructor(timeString)

make a parttime

Examples:

Construct

new PartTime()
new PartTime('*-10-12')
new PartTime('1970-1-1')
new PartTime('1970-1-1T00:*')
new PartTime('*:00:00.000')
new PartTime('*:*:30')
new PartTime('1970-1-1T00:00:00.000')

Parameters:

  • timeString ( String ) String value representing a parttime. The string should be in a format recognized by the PartTime.parse() method (yyyy-mm-ddT00:00:00.000).

Instance Method Details

# (Integer) getFullYear()

Returns:

  • ( Integer ) — the year

# (Integer) getMonth()

Returns:

  • ( Integer ) — the month (0-11)

# (Integer) getDate()

Returns:

  • ( Integer ) — the date

# (Integer) getHours()

Returns:

  • ( Integer ) — the hour

# (Integer) getMinutes()

Returns:

  • ( Integer ) — the minutes

# (Integer) getSeconds()

Returns:

  • ( Integer ) — the seconds

# (Integer) getMilliseconds()

Returns:

  • ( Integer ) — the milliseconds

# (Integer) compare(date_c)

compare with DateLike

Parameters:

  • date_c ( DateLike ) Date or DateLike (has getFullYear, getMonth, ... getMilliseconds)

Returns:

  • ( Integer ) — if this < date then negative else if this > date then positive else 0

# (String) toString()

Returns:

  • ( String ) — yyyy-mm-ddT00:00:00.000.

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: