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

Fix/preserve millsec #41

Merged
merged 2 commits into from
May 3, 2021
Merged

Conversation

leonardb
Copy link
Contributor

@leonardb leonardb commented May 3, 2021

Option to preserve milliseconds in date parsing and formatting

@choptastic
Copy link
Owner

This is great! Nice clean code with tests, even! Thank you!

@choptastic choptastic merged commit 69d7fdd into choptastic:master May 3, 2021
@leonardb
Copy link
Contributor Author

leonardb commented May 3, 2021

@choptastic Sorry with the late comment I was away after submitting the PR.

I thought I should ask if there is a better or preferred method for accessing the option rather than calling application:get_env/3 with every operation.

I'd noticed you placing some options into the process dictionary, but it was not clear if following that pattern was a 'better' method or not.

@choptastic
Copy link
Owner

That's a good question. I think it's probably fine, though if more and more options like this get added, it may be worth refactoring to add an actual Options argument to many of the functions. That, however, feels a little overkill.

The majority of the process dictionary stuff has to do with specific processes needing settings that my only apply to that process (the classic example is setting a timezone at the process level for different users connected to a web service).

In this situation, I suspect if you need sub-second accuracy, you might need universally, rather than at the process level.

That said, if there is a need where a user might need the sub-second accuracy, while others using the same system do not (or it would add confusion), then yes, it would be worth rejiggering to use the process dictionary.

I appreciate the thoughtfulness in this. I think for now, we're probably fine.

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

Successfully merging this pull request may close these issues.

2 participants