Skip to content

atsushi130/holiday-jp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

holiday-jp

MIT / Apache2.0 dual licensed crates.io Document

dependencies

[dependencies]
holiday_jp = "0.1.2"

Usage

extern crate holiday_jp;
extern crate chrono;

use holiday_jp::HolidayService;
use chrono::Local;

fn main() {
    let date = Local::now();
    if HolidayService.is_holiday(date) {
        println!("today is a holiday!");
    }
}

HolidayService API

fn is_holiday(&self, date: DateTime<Local>) -> bool;
fn is_weekend(&self, date: DateTime<Local>) -> bool;
fn is_public_holiday(&self, date: DateTime<Local>) -> bool;
fn is_beginning_of_the_year(&self, date: DateTime<Local>) -> bool;

DateTimeToString trait

use holiday_jp::DateTimeToString;

let date_time_string = Local::now().to_format_string();

License

This project is dual-licensed under MIT and Apache 2.0.

About

No description or website provided.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
license-apache.md
MIT
license-mit.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages