framadate-responsive/src/app/pages/visibility/visibility.component.ts

30 lines
942 B
TypeScript

import {Component, OnInit} from '@angular/core';
import {BaseComponent} from '../base-page/base.component';
import {ConfigService} from '../../services/config.service';
import {environment} from "../../../environments/environment";
@Component({
selector: 'framadate-visibility',
templateUrl: './visibility.component.html',
styleUrls: ['./visibility.component.scss']
})
export class VisibilityComponent extends BaseComponent implements OnInit {
showCustomPassword = false;
baseUrl = environment.baseApiHref;
environment = environment;
constructor(public config: ConfigService) {
super(config);
}
ngOnInit() {
this.config.customUrl = this.config.makeSlug();
this.config.expirationDate = (this.config.addDaysToDate(this.config.expiracyDateDefaultInDays, new Date())).toISOString().substring(0, 10);
}
submitCreationAndGoToEnd() {
this.config.createPoll();
}
}