Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more calendars. #142

Open
22 of 40 tasks
avhz opened this issue Oct 19, 2023 · 7 comments
Open
22 of 40 tasks

Add more calendars. #142

avhz opened this issue Oct 19, 2023 · 7 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@avhz
Copy link
Owner

avhz commented Oct 19, 2023

This just involves going through each country and completing the following boilerplate (using some source such as timeanddate.com).

pub struct Argentina;

impl Calendar for Argentina {
    fn name(&self) -> &'static str {
        "Argentina"
    }

    fn country_code(&self) -> crate::iso::ISO_3166 {
        crate::iso::ARGENTINA
    }

    // Use the MIC code for the primary stock exchange of the country.
    fn market_identifier_code(&self) -> crate::iso::ISO_10383 {
        crate::iso::XBUE
    }

    fn is_business_day(&self, date: OffsetDateTime) -> bool {
        let (w, d, m, y, dd) = self.unpack_date(date);
        let em = Self::easter_monday(y as usize, false);

        if Self::is_weekend(date)
            || (d == 25 && m == Month::December)  // Christmas
            || (d == 1 && m == Month::January)    // New Years Day
             ...                                  // and so on...
        {
            return false;
        }

        true
    }
}

To-do:

  • Argentina
  • Australia
  • Austria
  • Botswana
  • Brazil
  • Canada
  • Chile
  • China
  • Czech Republic
  • Denmark
  • Finland
  • France
  • Germany
  • Hong Kong
  • Hungary
  • Iceland
  • India
  • Indonesia
  • Israel
  • Italy
  • Japan
  • Mexico
  • New Zealand
  • Norway
  • Poland
  • Romania
  • Russia
  • Saudi Arabia
  • Singapore
  • Slovakia
  • South Africa
  • South Korea
  • Sweden
  • Switzerland
  • Taiwan
  • Thailand
  • Turkey
  • Ukraine
  • United Kingdom
  • United States of America
@avhz avhz added help wanted Extra attention is needed good first issue Good for newcomers labels Oct 19, 2023
@daksh-code
Copy link

can i take this task?

@avhz
Copy link
Owner Author

avhz commented Oct 25, 2023

Sure :) take a look at what is already implemented for an idea of what needs to be done.

Thanks for your interest !

@daksh-code
Copy link

daksh-code commented Oct 27, 2023

@avhz Getting this error while building locally on mac air m1.

dakshdagariya@Dakshs-MacBook-Air RustQuant % cargo build
error: failed to download `color_quant v1.1.0`

Caused by:
  unable to get `packages` from source

Caused by:
  failed to download replaced source registry `crates-io`

Caused by:
  failed to read `/Users/dakshdagariya/.cargo/registry/src/index.crates.io-6f17d22bba15001f/color_quant-1.1.0/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

@avhz
Copy link
Owner Author

avhz commented Oct 28, 2023

Hi, I'm not getting that error. Looks like a problem with the plotters crate.

Is your Rust up-to-date? Try rustup update and re-compile and let me know what happens.

Edit: probably also worth running cargo clean after updating Rust.

@daksh-code
Copy link

Hi thanks @avhz I'm able to build now but how to run this locally getting this.

dakshdagariya@Dakshs-MacBook-Air RustQuant % cargo run            
error: a bin target must be available for `cargo run`

@avhz
Copy link
Owner Author

avhz commented Oct 28, 2023

RustQuant is a library, not a binary. So you can't run it.

You may find the Rust book helpful: https://doc.rust-lang.org/book/

I believe there's a chapter about libraries and binaries.

@daksh-code
Copy link

okay thanks a lot.

@avhz avhz self-assigned this Nov 12, 2023
avhz added a commit that referenced this issue Nov 12, 2023
avhz added a commit that referenced this issue Nov 14, 2023
avhz added a commit that referenced this issue Nov 14, 2023
NicolasFrantzen added a commit to NicolasFrantzen/RustQuant that referenced this issue Nov 25, 2023
avhz added a commit that referenced this issue Nov 26, 2023
Denmark General Prayer Day removed as public holiday, #142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: No status
Development

No branches or pull requests

2 participants