1 unstable release

0.1.2 Nov 5, 2023
0.1.1 Nov 4, 2023
0.1.0 Nov 4, 2023

#475 in Text processing

Download history 32/week @ 2024-02-23 16/week @ 2024-03-01 1/week @ 2024-03-15 40/week @ 2024-03-29 11/week @ 2024-04-05

51 downloads per month

MIT license

10KB
124 lines

jcalendar

Japanese Calendar for Rust

Samples

  • setup Cal with base 4 colors
let cal = Cal::new(vec![
  (0x20, 0xC0, 0xF0), // 月-金
  (0xF0, 0xC0, 0x20), //
  (0xC0, 0x00, 0x00), //
  (0x00, 0xFF, 0x00)]).unwrap(); //
  • list days of current month
cal.show_list(Term::new().unwrap()).unwrap();
2023-11-013
2023-11-024
2023-11-035 文化の日
2023-11-046
2023-11-050
...
2023-11-293
2023-11-304
  • calender of current month (column width: 11, separate months: true)
cal.show_mat(Term::new().unwrap(), 11, true).unwrap();
2023-11
日         月         火         水         木         金         土
                                 01         02         03文化の日 04
05         06         07         08         09         10         11
12         13         14         15         16         17         18
19         20         21         22         23勤労感謝 24         25
26         27         28         29         30
  • calender any term (column width: 11, separate months: true)
cal.show_mat(Term{
  s: Date::parse("2023-10-29").expect("s"),
  e: Date::from_ymd(2023, 12, 2).expect("e")
}, 11, true).unwrap();
2023-10
日         月         火         水         木         金         土
29         30         31
2023-11
日         月         火         水         木         金         土
                                 01         02         03文化の日 04
05         06         07         08         09         10         11
12         13         14         15         16         17         18
19         20         21         22         23勤労感謝 24         25
26         27         28         29         30
2023-12
日         月         火         水         木         金         土
                                                       01         02
  • calender any term (column width: 11, separate months: false)
cal.show_mat(Term{
  s: Date::parse("2023-10-29").expect("s"),
  e: Date::from_ymd(2023, 12, 2).expect("e")
}, 11, false).unwrap();
2023-10
日         月         火         水         木         金         土
29         30         31         01         02         03文化の日 04
05         06         07         08         09         10         11
12         13         14         15         16         17         18
19         20         21         22         23勤労感謝 24         25
26         27         28         29         30         01         02

License

MIT License

Dependencies

~1–11MB
~75K SLoC