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

guidance on making datetimeoffset usable from fable python #208

Open
joprice opened this issue Oct 30, 2024 · 2 comments
Open

guidance on making datetimeoffset usable from fable python #208

joprice opened this issue Oct 30, 2024 · 2 comments

Comments

@joprice
Copy link

joprice commented Oct 30, 2024

I'm interested in fixing the issues with datetime wrt Python. I see the comment in the changelog regarding issues with the implementation, but is this still valid and if so, do you have any more details where perhaps I can try to do a pr to fable to fix it?

#if !FABLE_COMPILER_PYTHON

@MangelMaxime
Copy link
Contributor

I don't think the issue has been solved in Fable so the first thing will be to fix fable-library-py/date_offset.py in Fable.

I am just not sure, if we need to just fix the ToString("O") method or if like for DateTime we need to fix the whole type support.

In order to write, date_to_string_with_custom_format (for DateTime) I adapted the original C# code and transformed it into Python. But for DateTimeOffset we don't need to do the same because we can probably transform DateTimeOffset in a DateTime or share the logic.

If you want to learn how to work with Fable code, I did a F# Amplifying session. Or you can ping me on discord or slack, and we can hope in a call to get you started.

@joprice
Copy link
Author

joprice commented Oct 31, 2024

Great I'll watch that talk. I've written a Myriad plugin that I'm using to generate 10s of thousands of lines of encoders/decoders, and hit this when I started trying to use the shared models from fable python. For now, I might just make a newtype that wraps a unix timestamp represented in json as a string and avoid the problem altogether. Eventually, of course, it would be nice to have this supported universally.

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