summaryrefslogtreecommitdiff
path: root/src/viewmodel/dates.rs
diff options
context:
space:
mode:
authorjelemux <jeremias.weber@protonmail.com>2021-02-17 17:06:48 +0100
committerjelemux <jeremias.weber@protonmail.com>2021-02-17 17:06:48 +0100
commitcb310a66e94db4e0c4f7d0373a670156b012412a (patch)
tree501fd4ed17d892d693d4123fffaca8d942144e3b /src/viewmodel/dates.rs
parentbe3367dd2921eb30ae7970d233b83ac3af861952 (diff)
parent0660151a8b641fa0a23dde2598132029970f7ae4 (diff)
downloadwasm-card-cb310a66e94db4e0c4f7d0373a670156b012412a.tar.gz
wasm-card-cb310a66e94db4e0c4f7d0373a670156b012412a.tar.bz2
Merge branch 'main' of codeberg.org:jelemux/wasm-card
Diffstat (limited to 'src/viewmodel/dates.rs')
-rw-r--r--src/viewmodel/dates.rs45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/viewmodel/dates.rs b/src/viewmodel/dates.rs
deleted file mode 100644
index 7d8d394..0000000
--- a/src/viewmodel/dates.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-use super::*;
-use crate::view::dates::*;
-
-/// Type that represents the vcard `anniversary` and `birthday` properties.
-#[derive(Clone, Debug, PartialEq)]
-pub struct Dates {
- pub anniversary: String,
- pub birthday: String,
-}
-
-impl VCardPropertyInputObject<DatesView> for Dates {
- fn new() -> Self {
- Self {
- anniversary: String::new(),
- birthday: String::new(),
- }
- }
- fn get_input_fields(
- &self,
- link: &yew::html::Scope<DatesView>,
- ) -> std::vec::Vec<VCardPropertyInputField> {
- let typ = String::from("date");
- vec![
- VCardPropertyInputField::Text {
- label: "Anniversary".to_string(),
- id: Some("anniversary".to_string()),
- placeholder: None,
- oninput: link.callback(|e: InputData| Msg::UpdateAnniversary(e.value)),
- value: self.anniversary.clone(),
- typ: typ.clone(),
- },
- VCardPropertyInputField::Text {
- label: "Birthday".to_string(),
- id: Some("birthday".to_string()),
- placeholder: None,
- oninput: link.callback(|e: InputData| Msg::UpdateBirthday(e.value)),
- value: self.birthday.clone(),
- typ,
- },
- ]
- }
- fn is_empty(&self) -> bool {
- self.anniversary.is_empty() && self.birthday.is_empty()
- }
-}