projects/netgrif-components-core/src/lib/data-fields/date-time-field/models/date-time-field.ts
constructor(stringId: string, title: string, value: Moment, behavior: Behavior, placeholder?: string, description?: string, layout?: Layout, validations?: Array<Validation>, component?: Component, parentTaskId?: string)
|
| Public max |
Type : Moment
|
|
Inherited from
AbstractTimeInstanceField
|
|
Defined in
AbstractTimeInstanceField:21
|
| Public min |
Type : Moment
|
|
Inherited from
AbstractTimeInstanceField
|
|
Defined in
AbstractTimeInstanceField:20
|
| Protected _blockSubscription |
Type : Subscription
|
|
Inherited from
DataField
|
|
Defined in
DataField:71
|
| Protected _formControlValueSubscription |
Type : Subscription
|
|
Inherited from
DataField
|
|
Defined in
DataField:73
|
| Protected _initializedSubscription |
Type : Subscription
|
|
Inherited from
DataField
|
|
Defined in
DataField:103
|
|
Stores the last subscription to the _initialized$ Stream, to prevent multiple block events from executing at the same time |
| Protected _localLayout |
Type : Layout
|
|
Inherited from
DataField
|
|
Defined in
DataField:115
|
|
Stores a copy of the fields layout, that can be modified by the layouting algorithm as needed without affecting the base configuration. |
| Protected _myValueSubscription |
Type : Subscription
|
|
Inherited from
DataField
|
|
Defined in
DataField:74
|
| Protected _touchSubscription |
Type : Subscription
|
|
Inherited from
DataField
|
|
Defined in
DataField:72
|
| Protected _updateSubscription |
Type : Subscription
|
|
Inherited from
DataField
|
|
Defined in
DataField:70
|
| Protected _validators |
Type : Array<ValidatorFn>
|
|
Inherited from
DataField
|
|
Defined in
DataField:97
|
|
Validators resolved from field validations |
| Protected layoutSubject |
Type : BehaviorSubject<Layout>
|
|
Inherited from
DataField
|
|
Defined in
DataField:120
|
|
Listens for layout changes |
| Public Optional validations |
Type : Array<Validation>
|
|
Inherited from
DataField
|
|
Defined in
DataField:152
|
| Public getTypedComponentType |
getTypedComponentType()
|
|
Inherited from
DataField
|
|
Defined in
DataField:15
|
|
Returns :
string
|
| Protected valueEquality | |||||||||
valueEquality(a: Moment, b: Moment)
|
|||||||||
|
Inherited from
DataField
|
|||||||||
|
Defined in
DataField:19
|
|||||||||
|
Parameters :
Returns :
boolean
|
| Static isEqual | ||||||||||||
isEqual(a: Moment, b: Moment, granularity?: moment.unitOfTime.StartOf)
|
||||||||||||
|
Inherited from
AbstractTimeInstanceField
|
||||||||||||
|
Defined in
AbstractTimeInstanceField:28
|
||||||||||||
|
Parameters :
Returns :
boolean
|
| Static parseDate | ||||||||
parseDate(date: string)
|
||||||||
|
Inherited from
AbstractTimeInstanceField
|
||||||||
|
Defined in
AbstractTimeInstanceField:41
|
||||||||
|
Parse date from string: date is string 'past' - return string 'past' date is string 'future' - return string 'future' date is string 'today'/'now' - return moment instance of current date/time date is string build by combination of 'today'/'now'+/-ISO8601 (eg. today-P1DT1H) - return parsed moment instance of date date is string of specific date - return moment instance of this specific date
Parameters :
Returns :
any
|
| Protected resolveValidations |
resolveValidations()
|
|
Inherited from
DataField
|
|
Defined in
DataField:64
|
|
Returns :
Array<ValidatorFn>
|
| Protected validBetween | |||||||||
validBetween(first: Moment, second: Moment)
|
|||||||||
|
Inherited from
AbstractTimeInstanceField
|
|||||||||
|
Defined in
AbstractTimeInstanceField:106
|
|||||||||
|
Parameters :
Returns :
ValidatorFn
|
| Protected validFromPast | ||||||
validFromPast(range: Moment)
|
||||||
|
Inherited from
AbstractTimeInstanceField
|
||||||
|
Defined in
AbstractTimeInstanceField:98
|
||||||
|
Parameters :
Returns :
ValidatorFn
|
| Protected validToFuture | ||||||
validToFuture(range: Moment)
|
||||||
|
Inherited from
AbstractTimeInstanceField
|
||||||
|
Defined in
AbstractTimeInstanceField:102
|
||||||
|
Parameters :
Returns :
ValidatorFn
|
| Protected validWeekend | ||||||
validWeekend(fc: FormControl)
|
||||||
|
Inherited from
AbstractTimeInstanceField
|
||||||
|
Defined in
AbstractTimeInstanceField:115
|
||||||
|
Parameters :
Returns :
{ validWeekend: boolean; }
|
| Protected validWorkday | ||||||
validWorkday(fc: FormControl)
|
||||||
|
Inherited from
AbstractTimeInstanceField
|
||||||
|
Defined in
AbstractTimeInstanceField:110
|
||||||
|
Parameters :
Returns :
{ validWorkday: boolean; }
|
| Protected _determineFormControlValidity | ||||||||
_determineFormControlValidity(formControl: FormControl)
|
||||||||
|
Inherited from
DataField
|
||||||||
|
Defined in
DataField:490
|
||||||||
|
Computes whether the FormControl si valid.
Parameters :
Returns :
boolean
|
| Public applyChange | ||||||||
applyChange(change: Change)
|
||||||||
|
Inherited from
DataField
|
||||||||
|
Defined in
DataField:555
|
||||||||
|
Updates the state of this data field model object. Also see ChangedFields.
Parameters :
Returns :
void
|
| Protected calculateValidity | |||||||||
calculateValidity(forValidRequired: boolean, formControl: FormControl)
|
|||||||||
|
Inherited from
DataField
|
|||||||||
|
Defined in
DataField:598
|
|||||||||
|
Parameters :
Returns :
boolean
|
| Public clearValidators |
clearValidators()
|
|
Inherited from
DataField
|
|
Defined in
DataField:530
|
|
Returns :
void
|
| Public componentChange$ |
componentChange$()
|
|
Inherited from
DataField
|
|
Defined in
DataField:307
|
|
Returns :
Observable<Component>
|
| Public destroy |
destroy()
|
|
Inherited from
DataField
|
|
Defined in
DataField:393
|
|
Returns :
void
|
| Public disconnectFormControl |
disconnectFormControl()
|
|
Inherited from
DataField
|
|
Defined in
DataField:433
|
|
Returns :
void
|
| Public focus |
focus()
|
|
Inherited from
DataField
|
|
Defined in
DataField:357
|
|
Returns :
void
|
| Public getComponentType |
getComponentType()
|
|
Inherited from
DataField
|
|
Defined in
DataField:387
|
|
This function resolve type of component for HTML
Returns :
string
type of component in string |
| Public getUpdateOnStrategy |
getUpdateOnStrategy()
|
|
Inherited from
DataField
|
|
Defined in
DataField:379
|
|
Returns :
UpdateOnStrategy
|
| Public isInvalid | ||||||
isInvalid(formControl: FormControl)
|
||||||
|
Inherited from
DataField
|
||||||
|
Defined in
DataField:615
|
||||||
|
Parameters :
Returns :
boolean
|
| Public registerFormControl | ||||||
registerFormControl(formControl: FormControl)
|
||||||
|
Inherited from
DataField
|
||||||
|
Defined in
DataField:403
|
||||||
|
Parameters :
Returns :
void
|
| Public replaceValidations | ||||||
replaceValidations(validations: Array<Validation>)
|
||||||
|
Inherited from
DataField
|
||||||
|
Defined in
DataField:525
|
||||||
|
Parameters :
Returns :
void
|
| Public resetLocalLayout |
resetLocalLayout()
|
|
Inherited from
DataField
|
|
Defined in
DataField:622
|
|
Copies the layout settings into the local layout.
Returns :
void
|
| Public resolveAppearance | ||||||
resolveAppearance(config: ConfigurationService)
|
||||||
|
Inherited from
DataField
|
||||||
|
Defined in
DataField:571
|
||||||
|
Parameters :
Returns :
void
|
| Protected resolveFormControlValidators |
resolveFormControlValidators()
|
|
Inherited from
DataField
|
|
Defined in
DataField:506
|
|
Creates Validator objects based on field See Behavior for information about data field behavior. See ValidatorFn and Validators for information about Validators. Alternatively see Form Validation guide from Angular.
Returns :
Array<ValidatorFn>
|
| Public resolvePrevValue | ||||||
resolvePrevValue(value: T)
|
||||||
|
Inherited from
DataField
|
||||||
|
Defined in
DataField:591
|
||||||
|
Parameters :
Returns :
void
|
| Public revertToPreviousValue |
revertToPreviousValue()
|
|
Inherited from
DataField
|
|
Defined in
DataField:311
|
|
Returns :
void
|
| Protected subscribeToInnerSubjects | ||||||
subscribeToInnerSubjects(formControl: FormControl)
|
||||||
|
Inherited from
DataField
|
||||||
|
Defined in
DataField:458
|
||||||
|
Parameters :
Returns :
void
|
| Public update |
update()
|
|
Inherited from
DataField
|
|
Defined in
DataField:341
|
|
Returns :
void
|
| Protected updateFormControlState | ||||||
updateFormControlState(formControl: FormControl)
|
||||||
|
Inherited from
DataField
|
||||||
|
Defined in
DataField:452
|
||||||
|
Parameters :
Returns :
void
|
| Public valueChanges |
valueChanges()
|
|
Inherited from
DataField
|
|
Defined in
DataField:345
|
|
Returns :
Observable<T>
|
| Public valueWithoutChange | ||||||
valueWithoutChange(value: T)
|
||||||
|
Inherited from
DataField
|
||||||
|
Defined in
DataField:235
|
||||||
|
Parameters :
Returns :
void
|
import {Behavior} from '../../models/behavior';
import {Moment} from 'moment';
import {AbstractTimeInstanceField} from '../../time-instance-abstract-field/models/abstract-time-instance-field';
import {Layout} from '../../models/layout';
import {Validation} from '../../models/validation';
import {Component, ComponentPrefixes} from '../../models/component';
export class DateTimeField extends AbstractTimeInstanceField {
constructor(stringId: string, title: string, value: Moment, behavior: Behavior, placeholder?: string,
description?: string, layout?: Layout, validations?: Array<Validation>, component?: Component, parentTaskId?: string) {
super(stringId, title, value, behavior, placeholder, description, layout, validations, component, parentTaskId);
}
public getTypedComponentType(): string {
return ComponentPrefixes.DATE_TIME + this.getComponentType();
}
protected valueEquality(a: Moment, b: Moment): boolean {
return AbstractTimeInstanceField.isEqual(a, b, 'minute');
}
}