Documentation

Std.Time.Format.Basic

This module defines the Formatter types. It is based on the Java's DateTimeFormatter format.

The part of a formatting string. A string is just a text and a modifier is in the format described in the Modifier type.

Instances For
    @[instance_reducible]
    @[reducible, inline]

    The format of date and time string.

    Instances For

      If the format is aware of some timezone data it parses or if it parses any timezone.

      Instances For

        Configuration options for formatting and parsing date/time strings.

        • allowLeapSeconds : Bool

          Whether to allow leap seconds, such as 2016-12-31T23:59:60Z. Default is false.

        • dateformat : DateFormat

          Locale configuration for formatting and parsing, including locale-specific symbols and the first day of the week used for week-of-year and week-of-month calculations. Default is DateFormat.enUS (English, US).

        Instances For
          structure Std.Time.GenericFormat (awareness : Awareness) :

          A specification on how to format a data or parse some string.

          • config : FormatConfig

            Configuration options for formatting behavior.

          • string : FormatString

            The format string used for parsing and formatting.

          Instances For
            @[instance_reducible]

            Classify a PlainTime into a DayPeriod for the b pattern.

            Instances For

              Classify a PlainTime into an ExtendedDayPeriod for the B pattern (CLDR flexible periods).

              Instances For

                Parses a short month name using the given locale symbols and returns the corresponding Month.Ordinal.

                Instances For
                  Instances For

                    Constructs a new GenericFormat specification for a date-time string. Modifiers can be combined to create custom formats, such as "YYYY, MMMM, D".

                    Instances For

                      Builds a GenericFormat from the input string. If parsing fails, it will panic

                      Instances For

                        Formats a DateTime value into a string using the given GenericFormat.

                        Instances For

                          Parser for a format with a builder.

                          Instances For

                            Parses the input string into a DateTime.

                            Instances For

                              Parses the input string into a DateTime and panics if its wrong.

                              Instances For
                                def Std.Time.GenericFormat.parseBuilder {aw : Awareness} {α : Type} (format : GenericFormat aw) (builder : FormatType (Option α) format.string) (input : String) :

                                Parses an input string using a builder function to produce a value.

                                Instances For
                                  def Std.Time.GenericFormat.parseBuilder! {α : Type} {aw : Awareness} [Inhabited α] (format : GenericFormat aw) (builder : FormatType (Option α) format.string) (input : String) :
                                  α

                                  Parses an input string using a builder function, panicking on errors.

                                  Instances For
                                    def Std.Time.GenericFormat.formatGeneric {aw : Awareness} (format : GenericFormat aw) (getInfo : (typ : Modifier) → Option (TypeFormat typ)) :

                                    Formats the date using the format into a String, using a getInfo function to get the information needed to build the String.

                                    Instances For

                                      Constructs a FormatType function to format a date into a string using a GenericFormat.

                                      Instances For
                                        class Std.Time.Format (f : Type) (typ : TypefType) :

                                        Typeclass for formatting and parsing values with the given format type.

                                        • format (fmt : f) : typ String fmt

                                          Converts a format f into a string.

                                        • parse {α : Type} (fmt : f) : typ (Option α) fmtStringExcept String α

                                          Parses a string into a format using the provided format type f.

                                        Instances
                                          @[instance_reducible]