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

Global EndianPrecedence configuration isn't available #20

Open
adebisi-fa opened this issue Mar 13, 2017 · 0 comments
Open

Global EndianPrecedence configuration isn't available #20

adebisi-fa opened this issue Mar 13, 2017 · 0 comments

Comments

@adebisi-fa
Copy link

adebisi-fa commented Mar 13, 2017

Hi,

It appears it is currently not possible to GLOBALLY configure the default EndianPrecedence property of Options for new instances of the Chronic.Parser type, like it is available in the ruby clone (please check out this comment).

A public static non readonly field, as created for DefaultAmbiguousTimeRange, should be enough, like so:

// readonly modifier removed to allow re-configuration per AppDomain.
public static EndianPrecedence DefaultEndianPrecedence = EndianPrecedence.Middle;

then, can be used in the constructor like so:

...
EndianPrecedence = DefaultEndianPrecedence;
...

This will make the EndianPrecedence configuration globally, (say in Global.asax Application_Start), viz:

     protected void Application_Start(object sender, EventArgs e) {
          . . .
          Chronic.Options.DefaultEndianPrecedence = EndianPrecedence.Little;
          . . . 
     }

Can you please kindly get this fixed, or will a pull request be better?

Thanks, please.

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

1 participant