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.
22 lines
829 B
22 lines
829 B
import { environment } from '../../../environments/environment'; |
|
import { DateService } from '../services/date.service'; |
|
|
|
export class PollConfiguration { |
|
constructor( |
|
public isAboutDate: boolean = false, |
|
public isProtectedByPassword: boolean = false, |
|
public isOwnerNotifiedByEmailOnNewVote: boolean = false, |
|
public isOwnerNotifiedByEmailOnNewComment: boolean = false, |
|
public isMaybeAnswerAvailable: boolean = false, |
|
public areResultsPublic: boolean = true, |
|
public dateCreated: Date = new Date(Date.now()), |
|
public expires: Date = DateService.addDaysToDate( |
|
environment.poll.defaultConfig.expiracyInDays, |
|
new Date(Date.now()) |
|
) |
|
) {} |
|
|
|
public static isArchived(configuration: PollConfiguration): boolean { |
|
return configuration.expires ? DateService.isDateInPast(configuration.expires) : undefined; |
|
} |
|
}
|
|
|