Move date functions to a seperate file
This commit is contained in:
parent
2bd64cfb8a
commit
0f8cc4d020
|
@ -1,5 +1,6 @@
|
|||
use sycamore::prelude::*;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use crate::date::get_current_time_millis;
|
||||
|
||||
|
||||
use crate::{local_storage, AppMode};
|
||||
|
||||
|
@ -15,14 +16,6 @@ impl DefaultViewProps {
|
|||
}
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(js_name = getCurrentTimeMillis)]
|
||||
fn get_current_time_millis() -> usize;
|
||||
|
||||
#[wasm_bindgen(js_name = timeHR)]
|
||||
fn time_hr(millis: usize) -> String;
|
||||
}
|
||||
|
||||
#[component(DefaultView<G>)]
|
||||
pub fn default_view(props: DefaultViewProps) -> Template<G> {
|
||||
|
|
10
noters/src/date.rs
Normal file
10
noters/src/date.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(js_name = getCurrentTimeMillis)]
|
||||
pub fn get_current_time_millis() -> usize;
|
||||
|
||||
#[wasm_bindgen(js_name = timeHR)]
|
||||
pub fn time_hr(millis: usize) -> String;
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
mod components;
|
||||
mod console;
|
||||
mod date;
|
||||
mod local_storage;
|
||||
|
||||
use sycamore::prelude::*;
|
||||
|
|
Loading…
Reference in a new issue