monomer-1.0.0.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Monomer.Widgets.Singles.DateField

Description

Input field for dates types.

Supports the Day type of the time library, but other types can be supported by implementing DayConverter. Maybe is also supported.

Supports different date formats and separators.

Handles mouse wheel and shift + vertical drag to increase/decrease days.

Configs:

  • validInput: field indicating if the current input is valid. Useful to show warnings in the UI, or disable buttons if needed.
  • resizeOnChange: Whether input causes ResizeWidgets requests.
  • selectOnFocus: Whether all input should be selected when focus is received.
  • minValue: Minimum valid date.
  • maxValue: Maximum valid date.
  • wheelRate: The rate at which wheel movement affects the date.
  • dragRate: The rate at which drag movement affects the date.
  • onFocus: event to raise when focus is received.
  • onFocusReq: WidgetRequest to generate when focus is received.
  • onBlur: event to raise when focus is lost.
  • onBlurReq: WidgetRequest to generate when focus is lost.
  • onChange: event to raise when the value changes.
  • onChangeReq: WidgetRequest to generate when the value changes.
  • dateFormatDelimiter: which text delimiter to separate year, month and day.
  • dateFormatDDMMYYYY: using the current delimiter, accept DDMMYYYY.
  • dateFormatMMDDYYYY: using the current delimiter, accept MMDDYYYY.
  • dateFormatYYYYMMDD: using the current delimiter, accept YYYYMMDD.
Synopsis

Documentation

class (Eq a, Ord a, Show a, Typeable a) => DayConverter a where Source #

Converter to and form the Day type of the time library. To use types other than Day of said library, this typeclass needs to be implemented. -

Instances

Instances details
DayConverter Day Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

dateField :: (FormattableDate a, WidgetEvent e) => ALens' s a -> WidgetNode s e Source #

Creates a date field using the given lens.

dateField_ :: (FormattableDate a, WidgetEvent e) => ALens' s a -> [DateFieldCfg s e a] -> WidgetNode s e Source #

Creates a date field using the given lens. Accepts config.

dateFieldV :: (FormattableDate a, WidgetEvent e) => a -> (a -> e) -> WidgetNode s e Source #

Creates a date field using the given value and onChange event handler.

dateFieldV_ :: (FormattableDate a, WidgetEvent e) => a -> (a -> e) -> [DateFieldCfg s e a] -> WidgetNode s e Source #

Creates a date field using the given value and onChange event handler. Accepts config.

dateFormatDelimiter :: Char -> DateFieldCfg s e a Source #

Which character should be used to delimit dates.

dateFormatDDMMYYYY :: DateFieldCfg s e a Source #

Date format DDMMYYYY, using the appropriate delimiter.

dateFormatMMDDYYYY :: DateFieldCfg s e a Source #

Date format MMDDYYYY, using the appropriate delimiter.

dateFormatYYYYMMDD :: DateFieldCfg s e a Source #

Date format YYYYMMDD, using the appropriate delimiter.