Liking cljdoc? Tell your friends :D

second-date.parse.builder

Utility functions for programatically building a DateTimeFormatter. Easier to understand than chaining a hundred Java calls and trying to keep the structure straight.

The basic idea here is you pass a number of sections to formatter to build a DateTimeFormatter — see second-date.parse for examples. Most of these sections are simple wrappers around corresponding DateTimeFormatterBuilder -- see https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatterBuilder.html for documenation.

TODO - this is a prime library candidate.

Utility functions for programatically building a `DateTimeFormatter`. Easier to understand than chaining a hundred
Java calls and trying to keep the structure straight.

The basic idea here is you pass a number of `sections` to `formatter` to build a `DateTimeFormatter` — see
`second-date.parse` for examples. Most of these sections are simple wrappers around corresponding
`DateTimeFormatterBuilder` -- see
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatterBuilder.html for documenation.

TODO - this is a prime library candidate.
raw docstring

case-insensitiveclj

(case-insensitive & sections)

Make wrapped sections case-insensitive.

Make wrapped `sections` case-insensitive.
sourceraw docstring

case-sensitiveclj

(case-sensitive & sections)

Make wrapped sections case-sensitive.

Make wrapped `sections` case-sensitive.
sourceraw docstring

default-valueclj

(default-value temporal-field-name default-value)

Define a section that sets a default value for a field like :minute-of-hour.

Define a section that sets a default value for a field like `:minute-of-hour`.
sourceraw docstring

formatterclj

(formatter & sections)

Return a new DateTimeFormatter from sections. See examples in second-date.parse for more details.

(formatter (case-insensitive (value :hour-of-day 2) (optional ":" (value :minute-of-hour 2) (optional ":" (value :second-of-minute)))))

->

#object[java.time.format.DateTimeFormatter "ParseCaseSensitive(false)Value(HourOfDay,2)[':'Value(MinuteOfHour,2)[':'Value(SecondOfMinute)]]"]

Return a new `DateTimeFormatter` from `sections`. See examples in `second-date.parse` for more details.

(formatter
 (case-insensitive
  (value :hour-of-day 2)
  (optional
   ":"
   (value :minute-of-hour 2)
   (optional
    ":"
    (value :second-of-minute)))))

->

#object[java.time.format.DateTimeFormatter
        "ParseCaseSensitive(false)Value(HourOfDay,2)[':'Value(MinuteOfHour,2)[':'Value(SecondOfMinute)]]"]
sourceraw docstring

fractionclj

(fraction temporal-field-name
          min-val-width
          max-val-width
          &
          {:keys [decimal-point?]})

Define a section for a fractional value, e.g. milliseconds or nanoseconds.

Define a section for a fractional value, e.g. milliseconds or nanoseconds.
sourceraw docstring

lenientclj

(lenient & sections)

Use lenient parsing for wrapped sections.

Use lenient parsing for wrapped `sections`.
sourceraw docstring

optionalclj

(optional & sections)

Make wrapped sections optional.

Make wrapped `sections` optional.
sourceraw docstring

strictclj

(strict & sections)

Use strict parsing for wrapped sections.

Use strict parsing for wrapped `sections`.
sourceraw docstring

valueclj

(value temporal-field-name)
(value temporal-field-name width)
(value temporal-field-name min-val max-val sign-style-name)

Define a section for a specific field such as :hour-of-day or :minute-of-hour. Refer to second-date.common/temporal-field for all possible temporal fields names.

Define a section for a specific field such as `:hour-of-day` or `:minute-of-hour`. Refer to
`second-date.common/temporal-field` for all possible temporal fields names.
sourceraw docstring

zone-idclj

(zone-id)

An a section for a timezone ID wrapped in square brackets, e.g. [America/Los_Angeles].

An a section for a timezone ID wrapped in square brackets, e.g. `[America/Los_Angeles]`.
sourceraw docstring

zone-offsetclj

(zone-offset)

Define a section for a timezone offset. e.g. -08:00.

Define a section for a timezone offset. e.g. `-08:00`.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close