front end version 2 de framadate, un gestionnaire de sondage
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { environment } from '../../../environments/environment';
|
|
|
|
import { DateUtilsService } from '../utils/date-utils.service';
|
|
|
|
|
|
|
|
export class Configuration {
|
|
|
|
constructor(
|
|
|
|
public isAboutDate: boolean = false,
|
|
|
|
public isProtectedByPassword: boolean = false,
|
|
|
|
public isOwnerNotifiedByEmail: { onNewVote: boolean; onNewComment: boolean } = {
|
|
|
|
onNewVote: false,
|
|
|
|
onNewComment: false,
|
|
|
|
},
|
|
|
|
public isMaybeAnswerAvailable: boolean = false,
|
|
|
|
public areResultsPublic: boolean = false,
|
|
|
|
public dateCreated: Date = new Date(Date.now()),
|
|
|
|
public expires: Date = DateUtilsService.addDaysToDate(
|
|
|
|
environment.poll.defaultConfig.expiracyInDays,
|
|
|
|
new Date(Date.now())
|
|
|
|
)
|
|
|
|
) {}
|
|
|
|
|
|
|
|
public static isArchived(configuration: Configuration): boolean {
|
|
|
|
return DateUtilsService.isDateInPast(configuration.expires);
|
|
|
|
}
|
|
|
|
}
|