webserver_base/templates/schema/copyright.rs
1use chrono::{Datelike, Utc};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct Copyright {
6 pub start: String,
7 pub end: String,
8}
9
10impl Copyright {
11 #[must_use]
12 pub fn new(start: String) -> Self {
13 Self {
14 start,
15 end: Utc::now().year().to_string(),
16 }
17 }
18}