monomer-1.0.0.1: 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.

Synopsis

Configuration

data DateFieldCfg s e a Source #

Configuration options for dateField:

Instances

Instances details
Semigroup (DateFieldCfg s e a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

(<>) :: DateFieldCfg s e a -> DateFieldCfg s e a -> DateFieldCfg s e a #

sconcat :: NonEmpty (DateFieldCfg s e a) -> DateFieldCfg s e a #

stimes :: Integral b => b -> DateFieldCfg s e a -> DateFieldCfg s e a #

Monoid (DateFieldCfg s e a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

mempty :: DateFieldCfg s e a #

mappend :: DateFieldCfg s e a -> DateFieldCfg s e a -> DateFieldCfg s e a #

mconcat :: [DateFieldCfg s e a] -> DateFieldCfg s e a #

Default (DateFieldCfg s e a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

def :: DateFieldCfg s e a #

CmbResizeOnChange (DateFieldCfg s e a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

CmbSelectOnFocus (DateFieldCfg s e a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

CmbCaretMs (DateFieldCfg s e a) Int Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

caretMs :: Int -> DateFieldCfg s e a Source #

CmbCaretWidth (DateFieldCfg s e a) Double Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

CmbWheelRate (DateFieldCfg s e a) Double Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

wheelRate :: Double -> DateFieldCfg s e a Source #

CmbDragRate (DateFieldCfg s e a) Double Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

dragRate :: Double -> DateFieldCfg s e a Source #

FormattableDate a => CmbMaxValue (DateFieldCfg s e a) a Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

maxValue :: a -> DateFieldCfg s e a Source #

FormattableDate a => CmbMinValue (DateFieldCfg s e a) a Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

minValue :: a -> DateFieldCfg s e a Source #

CmbValidInputV (DateFieldCfg s e a) e Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

validInputV :: (Bool -> e) -> DateFieldCfg s e a Source #

CmbValidInput (DateFieldCfg s e a) s Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

validInput :: ALens' s Bool -> DateFieldCfg s e a Source #

WidgetEvent e => CmbOnChange (DateFieldCfg s e a) a e Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

onChange :: (a -> e) -> DateFieldCfg s e a Source #

WidgetEvent e => CmbOnBlur (DateFieldCfg s e a) e Path Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

onBlur :: (Path -> e) -> DateFieldCfg s e a Source #

WidgetEvent e => CmbOnFocus (DateFieldCfg s e a) e Path Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

onFocus :: (Path -> e) -> DateFieldCfg s e a Source #

CmbOnChangeReq (DateFieldCfg s e a) s e a Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

onChangeReq :: (a -> WidgetRequest s e) -> DateFieldCfg s e a Source #

CmbOnBlurReq (DateFieldCfg s e a) s e Path Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

onBlurReq :: (Path -> WidgetRequest s e) -> DateFieldCfg s e a Source #

CmbOnFocusReq (DateFieldCfg s e a) s e Path Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

onFocusReq :: (Path -> WidgetRequest s e) -> DateFieldCfg s e a Source #

type FormattableDate a = (Eq a, Ord a, Show a, DateTextConverter a, Typeable a) Source #

Constraints for date types accepted by dateField.

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

class DateTextConverter a Source #

Converts a Day instance to and from Text.

Minimal complete definition

dateAcceptText, dateFromText, dateToText, dateFromDay, dateToDay

Instances

Instances details
DayConverter a => DateTextConverter a Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

dateAcceptText :: DateFormat -> Char -> Maybe a -> Maybe a -> Text -> (Bool, Bool, Maybe a)

dateFromText :: DateFormat -> Char -> Text -> Maybe a

dateToText :: DateFormat -> Char -> a -> Text

dateFromDay :: Day -> a

dateToDay :: a -> Maybe Day

(DayConverter a, DateTextConverter a) => DateTextConverter (Maybe a) Source # 
Instance details

Defined in Monomer.Widgets.Singles.DateField

Methods

dateAcceptText :: DateFormat -> Char -> Maybe (Maybe a) -> Maybe (Maybe a) -> Text -> (Bool, Bool, Maybe (Maybe a))

dateFromText :: DateFormat -> Char -> Text -> Maybe (Maybe a)

dateToText :: DateFormat -> Char -> Maybe a -> Text

dateFromDay :: Day -> Maybe a

dateToDay :: Maybe a -> Maybe Day

Constructors

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.