massivefermion / birl

datetime handling for gleam
https://hex.pm/packages/birl
Apache License 2.0
72 stars 9 forks source link

parse and to_string for Weekday and TimeOfDay #25

Closed DominikLutley closed 6 months ago

DominikLutley commented 6 months ago

Hey, I've been using this package and am finding it very useful.

I'm working a lot with TimeOfDay and Weekday and found myself writing a few helper functions, particularly parse_weekday(), week_day_to_string() and time_of_day_to_string().

Are these something you would be interested in adding to the package? I could work on this if you'd like.

massivefermion commented 6 months ago

Hi Great to know people find this package useful Sure, if you had a use-case for those functions, there are probably other people who may need them. I'd appreciate a PR. And now that you mentioned the names of the functions, I think week_day_to_string should be weekday_to_string! Thanks

DominikLutley commented 6 months ago

Great! Yes you're right about weekday :+1: I'll make a PR soon.

DominikLutley commented 6 months ago

What do you think about making separate modules for weekday and time_of_day? It would then make sense to move parse_time_of_day and parse_naive_time_of_day to the time_of_day module.

massivefermion commented 6 months ago

I can see your point, but for now I prefer to have them in src/birl.gleam. I'll probably try to do a redesign for a version 2 and that can be part of it.