struct DynFork::Fields::DateTimeField

Overview

A field for entering a date and time.
Formats: dd-mm-yyyy hh:mm:ss | dd/mm/yyyy hh:mm:ss | dd.mm.yyyy hh:mm:ss | dd-mm-yyyyThh:mm:ss | dd/mm/yyyyThh:mm:ss | dd.mm.yyyyThh:mm:ss | yyyy-mm-dd hh:mm:ss | yyyy/mm/dd hh:mm:ss | yyyy.mm.dd hh:mm:ss | yyyy-mm-ddThh:mm:ss | yyyy/mm/ddThh:mm:ss | yyyy.mm.ddThh:mm:ss

Included Modules

Defined in:

dynfork/fields/date_time.cr

Constructors

Instance Method Summary

Instance methods inherited from module DynFork::Globals::Date

date_parse(date : String) : Time date_parse, datetime_parse(datetime : String) : Time datetime_parse

Instance methods inherited from struct DynFork::Fields::Field

choices_from_json(json : String) : Nil choices_from_json, disabled=(disabled : Bool) disabled=, disabled? : Bool disabled?, errors : Array(String) errors, errors=(errors : Array(String)) errors=, field_type : String field_type, group : UInt8 group, hide=(hide : Bool) hide=, hide? : Bool hide?, hint : String hint, id : String id, id=(id : String) id=, ignored? : Bool ignored?, label : String label, name : String name, name=(name : String) name=, readonly=(readonly : Bool) readonly=, readonly? : Bool readonly?, required? : Bool required?, slug_sources : Array(String) slug_sources, warning : String warning, warning=(warning : String) warning=

Constructor methods inherited from struct DynFork::Fields::Field

new(pull : JSON::PullParser) new

Constructor Detail

def self.new(pull : JSON::PullParser) #

A field for entering a date and time.
Formats: dd-mm-yyyy hh:mm:ss | dd/mm/yyyy hh:mm:ss | dd.mm.yyyy hh:mm:ss | dd-mm-yyyyThh:mm:ss | dd/mm/yyyyThh:mm:ss | dd.mm.yyyyThh:mm:ss | yyyy-mm-dd hh:mm:ss | yyyy/mm/dd hh:mm:ss | yyyy.mm.dd hh:mm:ss | yyyy-mm-ddThh:mm:ss | yyyy/mm/ddThh:mm:ss | yyyy.mm.ddThh:mm:ss


[View source]
def self.new(label : String = "", default : String | Nil = nil, placeholder : String = "", max : String | Nil = nil, min : String | Nil = nil, hide : Bool = false, required : Bool = false, disabled : Bool = false, readonly : Bool = false, ignored : Bool = false, hint : String = I18n.t("formats.interpolation", samples: (((("dd-mm-yyyy hh:mm:ss | dd/mm/yyyy hh:mm:ss | " + "dd.mm.yyyy hh:mm:ss | dd-mm-yyyyThh:mm:ss | ") + "dd/mm/yyyyThh:mm:ss | dd.mm.yyyyThh:mm:ss | ") + "yyyy-mm-dd hh:mm:ss | yyyy/mm/dd hh:mm:ss | ") + "yyyy.mm.dd hh:mm:ss | yyyy-mm-ddThh:mm:ss | ") + "yyyy/mm/ddThh:mm:ss | yyyy.mm.ddThh:mm:ss")) #

[View source]

Instance Method Detail

def default : String | Nil #

Value by default.
Example: 1970-01-01T00:00:00


[View source]
def default? : String | Nil | Nil #

Value by default.
Example: 1970-01-01T00:00:00


[View source]
def field_type : String #

Field type - Structure Name.


[View source]
def group : UInt8 #

To optimize field traversal in the paladins/check() method.

WARNING It is recommended not to change.


[View source]
def hint : String #

Additional explanation for the user.


[View source]
def input_type : String | Nil #

Html tag: input type="datetime".


[View source]
def input_type? : String | Nil | Nil #

Html tag: input type="datetime".


[View source]
def max : String | Nil #

The top value for entering a date and time.


[View source]
def max? : String | Nil | Nil #

The top value for entering a date and time.


[View source]
def min : String | Nil #

The lower value for entering a date and time.


[View source]
def min? : String | Nil | Nil #

The lower value for entering a date and time.


[View source]
def placeholder : String #

Displays prompt text.


[View source]
def refrash_val_datetime(val : Time) : Nil #

[View source]
def time_object? : Time | Nil #

Get time object from value.


[View source]
def value : String | Nil #

Sets the value of an element.
Example: 1970-01-01T00:00:00


def value=(value : String | Nil) #

Sets the value of an element.
Example: 1970-01-01T00:00:00


[View source]
def value? : String | Nil | Nil #

Sets the value of an element.
Example: 1970-01-01T00:00:00