Home Reference Source Repository
import {DateTimeBuilder} from 'js-joda/src/format/DateTimeBuilder.js'
public class | source

DateTimeBuilder

Extends:

TemporalAccessorTemporal → DateTimeBuilder

Builder that can holds date and time fields and related date and time objects.

The builder is used to hold onto different elements of date and time. It is designed as two separate maps:

Static Method Summary

Static Public Methods
public static

Creates a new instance of the builder with a single field-value.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

The chronology.

public

The date.

public

The excess days.

public

The map of other fields.

public

The leap second flag.

public

The time.

public

The zone.

Method Summary

Public Methods
public

build(type: TemporalQuery): *

Builds the specified type from the values in this builder.

public
public
public
public

query(query: TemporalQuery): *

public

resolve(resolverStyle: ResolverStyle, resolverFields: TemporalField[]): DateTimeBuilder

Resolves the builder, evaluating the date and time.

Inherited Summary

From class TemporalAccessor
public

Gets the value of the specified field as an int.

public

query(query: TemporalQuery): *

Queries this date-time.

public

Gets the range of valid values for the specified field.

Static Public Methods

public static create(field: TemporalField, value: number): DateTimeBuilder source

Creates a new instance of the builder with a single field-value.

This is equivalent to using addFieldValue on an empty builder.

Params:

NameTypeAttributeDescription
field TemporalField

the field to add, not null

value number

the value to add, not null

Return:

DateTimeBuilder

Public Constructors

public constructor() source

Public Members

public chrono: undefined source

The chronology.

public date: undefined source

The date.

public excessDays: undefined source

The excess days.

public fieldValues: * source

The map of other fields.

public leapSecond: boolean source

The leap second flag.

public time: undefined source

The time.

public zone: undefined source

The zone.

Public Methods

public build(type: TemporalQuery): * source

Builds the specified type from the values in this builder.

This attempts to build the specified type from this builder. If the builder cannot return the type, an exception is thrown.

Params:

NameTypeAttributeDescription
type TemporalQuery
  • nullable: false

the type to invoke from on, not null

Return:

*

the extracted value, not null

Throw:

*

DateTimeException if an error occurs

public getFieldValue0(field: TemporalField): Number source

Params:

NameTypeAttributeDescription
field TemporalField

Return:

Number

field value

public getLong(field: TemporalField): number source

Params:

NameTypeAttributeDescription
field TemporalField

Return:

number

public isSupported(field: TemporalField): number source

Params:

NameTypeAttributeDescription
field TemporalField

Return:

number

public query(query: TemporalQuery): * source

Override:

TemporalAccessor#query

Params:

NameTypeAttributeDescription
query TemporalQuery
  • nullable: false

Return:

*

public resolve(resolverStyle: ResolverStyle, resolverFields: TemporalField[]): DateTimeBuilder source

Resolves the builder, evaluating the date and time.

This examines the contents of the build.er and resolves it to produce the best available date and time, throwing an exception if a problem occurs. Calling this method changes the state of the builder.

Params:

NameTypeAttributeDescription
resolverStyle ResolverStyle

how to resolve

resolverFields TemporalField[]

Return:

DateTimeBuilder

this, for method chaining