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

Gregorian to Maya LC conversion #15

Open
VitalyChe opened this issue Aug 1, 2020 · 5 comments
Open

Gregorian to Maya LC conversion #15

VitalyChe opened this issue Aug 1, 2020 · 5 comments

Comments

@VitalyChe
Copy link

Thanks for the lib!
Is there any way to convert Gregorian to Maya LC?

@drewsonne
Copy link
Owner

Good question. I don't actually think there is at the moment. I'm working on the library today, so I'll have a crack at it.

@VitalyChe
Copy link
Author

Would be nice to have it, as it's kind of a blocker to start looking into Mayan dates

@drewsonne
Copy link
Owner

I don't have a good way to handle the conversion between julian and gregorian, so I'm probably not going to get a chance at this until I finish the calculator driving this project.
If you're up for it, you can take the test cases and the method I was looking at here https://github.com/drewsonne/maya-dates/compare/feature/western-to-lc?expand=1 and try and implement it.

@drewsonne
Copy link
Owner

If you're looking for getting started with understanding maya dates, I'd try running something like

import {origin} from "@drewsonne/maya-dates/cr/calendar-round";

console.log(`${origin}`)
let cr = origin.next()
console.log(`${cr}`)
while (!origin.equal(cr)) {
    console.log(`${cr}`)
    cr = cr.next()
}

should give you an idea of how the calendar round works.

@VitalyChe
Copy link
Author

Thanks, I'll have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants