Skip to content

Commit dd18473

Browse files
committed
added use_calendar
1 parent ebf12c2 commit dd18473

File tree

17 files changed

+794
-2
lines changed

17 files changed

+794
-2
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## [0.13.13] - 2025-01-07
7+
8+
### New Functions 🚀
9+
10+
- `use_calendar`
11+
12+
Thanks to our generous sponsor:
13+
- @spencewenski
14+
615
## [0.13.12] - 2025-01-03
716

817
- Fixed path of use_color_mode cookie

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "leptos-use"
3-
version = "0.13.12"
3+
version = "0.13.13"
44
edition = "2021"
55
authors = ["Marc-Stefan Cassola"]
66
categories = ["gui", "web-programming"]
@@ -16,6 +16,7 @@ homepage = "https://leptos-use.rs"
1616
actix-web = { version = "4", optional = true, default-features = false }
1717
async-trait = { version = "0.1", optional = true }
1818
cfg-if = "1"
19+
chrono = "0.4"
1920
codee = { version = "0.2", optional = true }
2021
cookie = { version = "0.18", features = ["percent-encode"], optional = true }
2122
default-struct-builder = "0.5"
@@ -63,6 +64,7 @@ default = [
6364
"use_active_element",
6465
"use_breakpoints",
6566
"use_broadcast_channel",
67+
"use_calendar",
6668
"use_clipboard",
6769
"use_color_mode",
6870
"use_cookie",
@@ -123,6 +125,7 @@ default = [
123125
"watch_with_options",
124126
"whenever"
125127
]
128+
use_calendar = []
126129
use_textarea_autosize = [
127130
"use_resize_observer",
128131
"web-sys/CssStyleDeclaration",

docs/book/src/SUMMARY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
- [use_timeout_fn](animation/use_timeout_fn.md)
8484
- [use_timestamp](animation/use_timestamp.md)
8585

86+
# Component
87+
88+
- [use_calendar](component/use_calendar.md)
89+
8690
# Watch
8791

8892
- [watch_debounced](watch/watch_debounced.md)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# use_calendar
2+
3+
<!-- cmdrun python3 ../extract_doc_comment.py use_calendar use_calendar -->

examples/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ members = [
1111
"use_and",
1212
"use_breakpoints",
1313
"use_broadcast_channel",
14+
"use_calendar",
1415
"use_ceil",
1516
"use_clipboard",
1617
"use_color_mode",

examples/use_calendar/Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "use_calendar"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
leptos = { version = "0.6", features = ["nightly", "csr"] }
8+
console_error_panic_hook = "0.1"
9+
console_log = "1"
10+
log = "0.4"
11+
leptos-use = { path = "../..", features = ["use_calendar", "docs"] }
12+
web-sys = "0.3"
13+
chrono = "0.4"
14+
15+
[dev-dependencies]
16+
wasm-bindgen = "0.2"
17+
wasm-bindgen-test = "0.3.0"

examples/use_calendar/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
A simple example for `use_calendar`.
2+
3+
If you don't have it installed already, install [Trunk](https://trunkrs.dev/) and [Tailwind](https://tailwindcss.com/docs/installation)
4+
as well as the nightly toolchain for Rust and the wasm32-unknown-unknown target:
5+
6+
```bash
7+
cargo install trunk
8+
npm install -D tailwindcss @tailwindcss/forms
9+
rustup toolchain install nightly
10+
rustup target add wasm32-unknown-unknown
11+
```
12+
13+
Then, open two terminals. In the first one, run:
14+
15+
```
16+
npx tailwindcss -i ./input.css -o ./style/output.css --watch
17+
```
18+
19+
In the second one, run:
20+
21+
```bash
22+
trunk serve --open
23+
```

examples/use_calendar/Trunk.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
public_url = "/demo/"

examples/use_calendar/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<link data-trunk rel="tailwind-css" href="input.css" >
5+
</head>
6+
<body></body>
7+
</html>

examples/use_calendar/input.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

0 commit comments

Comments
 (0)