timemanager/frontend/src/app/tasks/task-editor/task-editor.component.ts

24 lines
814 B
TypeScript

import { Component, OnInit } from '@angular/core';
import {UntypedFormControl, Validators} from "@angular/forms";
import * as _moment from 'moment';
import {DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE} from "@angular/material/core";
import {MomentDateAdapter} from "@angular/material-moment-adapter";
const moment = _moment;
@Component({
selector: 'app-task-editor',
templateUrl: './task-editor.component.html',
styleUrls: ['./task-editor.component.css'],
})
export class TaskEditorComponent implements OnInit {
nameCtrl = new UntypedFormControl('', [Validators.required, Validators.maxLength(255)])
etaCtrl = new UntypedFormControl(0, [Validators.required, Validators.min(0)])
startDate = new UntypedFormControl(moment.now, [Validators.required])
constructor() { }
ngOnInit(): void {
}
}