Constructor
new LocalDate(year, month, day)
Creates a new instance of LocalDate.
Parameters:
Name | Type | Description |
---|---|---|
year |
Number | The year or days since epoch. If days since epoch, month and day should not be provided. |
month |
Number | Between 1 and 12 inclusive. |
day |
Number | Between 1 and the number of days in the given month of the given year. |
Properties:
Name | Type | Description |
---|---|---|
date |
Date | The date representation if falls within a range of an ES5 data type, otherwise an invalid date. |
- Source:
Members
(readonly) _value :Number
If date cannot be represented yet given a valid days since epoch, track it internally.
Type:
- Number
- Deprecated:
- This member is in Datastax documentation, but it seems to not be exposed in the API. Additionally we added a new class member: `value` that always returns days since epoch regardless of the date.
- Source:
(readonly) date :Date
Date object represent this date.
Type:
- Date
- Source:
(readonly) day :Number
A number between 1 and the number of days in the given month of the given year (value up to 31). May return NaN if cannot be represented as a Date.
Type:
- Number
- Source:
(readonly) month :Number
A number between 1 and 12 inclusive representing the month. May return NaN if cannot be represented as a Date.
Type:
- Number
- Source:
(readonly) value :Number
Always valid amount of days since epoch.
Type:
- Number
- Source:
(readonly) year :Number
A number representing the year. May return NaN if cannot be represented as a Date.
Type:
- Number
- Source:
Methods
compare(other) → {number}
Compares this LocalDate with the given one.
Parameters:
Name | Type | Description |
---|---|---|
other |
LocalDate | date to compare against. |
- Source:
Returns:
0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
- Type
- number
equals(other) → {Boolean}
Returns true if the value of the LocalDate instance and other are the same
Parameters:
Name | Type | Description |
---|---|---|
other |
LocalDate |
- Source:
Returns:
- Type
- Boolean
(package) getInternal() → {rust.LocalDateWrapper}
- Source:
Returns:
- Type
- rust.LocalDateWrapper
inspect() → {string}
Provide the name of the constructor and the string representation
- Source:
Returns:
- Type
- string
toBuffer() → {Buffer}
Gets the bytes representation of the instance.
- Source:
Returns:
- Type
- Buffer
toJSON() → {string}
Gets the string representation of the instance in the form: yyyy-mm-dd, valid for JSON.
- Source:
Returns:
- Type
- string
toString() → {string}
Gets the string representation of the instance in the form: yyyy-mm-dd if the value can be parsed as a Date, otherwise days since epoch.
- Source:
Returns:
- Type
- string
(static) fromBuffer(buffer) → {LocalDate}
Creates a new instance of LocalDate using the bytes representation.
Parameters:
Name | Type | Description |
---|---|---|
buffer |
Buffer |
- Source:
Returns:
- Type
- LocalDate
(static) fromDate(date) → {LocalDate}
Creates a new instance of LocalDate using the year, month and day from the provided local date time.
Parameters:
Name | Type | Description |
---|---|---|
date |
Date |
- Source:
Returns:
- Type
- LocalDate
(package, static) fromRust(arg) → {LocalDate}
Get LocalDate from rust object.
Parameters:
Name | Type | Description |
---|---|---|
arg |
rust.LocalDateWrapper |
- Source:
Returns:
- Type
- LocalDate
(static) fromString(value) → {LocalDate}
Creates a new instance of LocalDate using the year, month and day provided in the form: yyyy-mm-dd or days since epoch (i.e. -1 for Dec 31, 1969).
Parameters:
Name | Type | Description |
---|---|---|
value |
string |
- Source:
Returns:
- Type
- LocalDate
(static) now()
Creates a new instance of LocalDate using the current year, month and day from the system clock in the default time-zone.
- Source:
(static) utcNow()
Creates a new instance of LocalDate using the current date from the system clock at UTC.
- Source: