Function
Static Public Summary | ||
public |
abstractMethodFail(methodName: *) |
|
public |
assert(assertion: *, msg: *, error: *) |
|
public |
convert(temporal: LocalDate | LocalDateTime | ZonedDateTime, zone: ZoneId): ToNativeJsConverter converts a LocalDate, LocalDateTime or ZonedDateTime to a native Javascript Date. |
|
public |
createTemporalQuery(name: *, queryFromFunction: *): * Factory to create something similar to the JSR-310 {TemporalQuery} interface, takes a function and returns a new TemporalQuery object that presents that function as the queryFrom() function. |
|
public |
|
|
public |
requireInstance(value: *, _class: *, parameterName: *): * |
|
public |
requireNonNull(value: *, parameterName: *): * |
|
public |
use |
Static Public
public abstractMethodFail(methodName: *) source
import {abstractMethodFail} from 'js-joda/src/assert.js'
Params:
Name | Type | Attribute | Description |
methodName | * |
public assert(assertion: *, msg: *, error: *) source
import {assert} from 'js-joda/src/assert.js'
Params:
Name | Type | Attribute | Description |
assertion | * | ||
msg | * | ||
error | * |
public convert(temporal: LocalDate | LocalDateTime | ZonedDateTime, zone: ZoneId): ToNativeJsConverter source
import {convert} from 'js-joda/src/convert.js'
converts a LocalDate, LocalDateTime or ZonedDateTime to a native Javascript Date.
In a first step the temporal is converted to an Instant by adding implicit values.
A LocalDate is implicit set to a LocalDateTime at start of day. A LocalDateTime is implicit set to a ZonedDateTime with the passed zone or if null, with the system default time zone. A ZonedDateTime is converted to an Instant, if a zone is specified the zonedDateTime is adjusted to this zone, keeping the same Instant.
In a second step the instant is converted to a native Javascript Date
default zone for LocalDate and LocalDateTime is ZoneId.systemDefault().
Params:
Name | Type | Attribute | Description |
temporal | LocalDate | LocalDateTime | ZonedDateTime |
|
a joda temporal instance |
zone | ZoneId |
|
the zone of the temporal |
Return:
ToNativeJsConverter |
Example:
convert(localDate).toDate() // returns a javascript Date
convert(localDate).toEpochMilli() // returns the epochMillis
public createTemporalQuery(name: *, queryFromFunction: *): * source
import {createTemporalQuery} from 'js-joda/src/temporal/TemporalQuery.js'
Factory to create something similar to the JSR-310 {TemporalQuery} interface, takes a function and returns a new TemporalQuery object that presents that function as the queryFrom() function.
Params:
Name | Type | Attribute | Description |
name | * | for the underlying Enum |
|
queryFromFunction | * |
Return:
* |
public nativeJs(date: Date | moment, zone: ZoneId): NativeJsTemporal source
import {nativeJs} from 'js-joda/src/temporal/NativeJsTemporal.js'
Return:
NativeJsTemporal |
public requireInstance(value: *, _class: *, parameterName: *): * source
import {requireInstance} from 'js-joda/src/assert.js'
Params:
Name | Type | Attribute | Description |
value | * | ||
_class | * | ||
parameterName | * |
Return:
* |
public requireNonNull(value: *, parameterName: *): * source
import {requireNonNull} from 'js-joda/src/assert.js'
Params:
Name | Type | Attribute | Description |
value | * | ||
parameterName | * |
Return:
* |
public use(fn: function): this source
import {use} from 'js-joda/src/js-joda.js'
use
Provides a way to extend the internals of js-joda
Params:
Name | Type | Attribute | Description |
fn | function | function to extend js-joda public api |
Return:
this | for chaining |