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

FractionPrinterParser

TODO optimize FractionPrinterParser, fix documentation

Prints and parses a numeric date-time field with optional padding.

Constructor Summary

Public Constructor
public

constructor(field: TemporalField, minWidth: Number, maxWidth: Number, decimalPoint: boolean)

Constructor.

Member Summary

Public Members
public
public

field: *

public
public

Method Summary

Public Methods
public
public
public

parse(context: *, text: *, position: *): *

public

print(context: *, buf: *): boolean

public

toString(): *

Public Constructors

public constructor(field: TemporalField, minWidth: Number, maxWidth: Number, decimalPoint: boolean) source

Constructor.

Params:

NameTypeAttributeDescription
field TemporalField

the field to output, not null

minWidth Number

the minimum width to output, from 0 to 9

maxWidth Number

the maximum width to output, from 0 to 9

decimalPoint boolean

whether to output the localized decimal point symbol

Public Members

public decimalPoint: * source

public field: * source

public maxWidth: * source

public minWidth: * source

Public Methods

public convertFromFraction(fraction: Number): Number source

Params:

NameTypeAttributeDescription
fraction Number

the fraction to convert, not null

Return:

Number

the value of the field, valid for this rule

Throw:

*

DateTimeException if the value cannot be converted

public convertToFraction(value: Number): String source

Params:

NameTypeAttributeDescription
value Number

the value to convert, must be valid for this rule

Return:

String

the value as a fraction within the range, from 0 to 1, not null

public parse(context: *, text: *, position: *): * source

Params:

NameTypeAttributeDescription
context *
text *
position *

Return:

*

public print(context: *, buf: *): boolean source

Params:

NameTypeAttributeDescription
context *
buf *

Return:

boolean

public toString(): * source

Return:

*