jason-roberts / FeatureToggle

Simple, reliable feature toggles in .NET
http://dontcodetired.com/blog/?tag=/featuretoggle
Apache License 2.0
687 stars 111 forks source link

Enable Time Zone / UTC Specification in DateTime Based Toggles #123

Open raleighbuckner opened 8 years ago

raleighbuckner commented 8 years ago

Initial thoughts on this:

Unfortunately, this would be a breaking change since the new ExpectedDateFormat would not be compatible with older configuration settings that don't have the time zone information.

A possible other solution would be to:

Let me know what you think and I should be able to create a pull request for either route. Thanks!

raleighbuckner commented 8 years ago

Oh - reasoning for this... As it stands now, the times are being parsed as Local times, so the timezone is that of the machine where the app is running. This can cause the features to be enabled/disabled at the wrong time if the machine executing the code is in a different time zone than the developer. For example, developer in Eastern TZ in the US, but the server is set to UTC.

jason-roberts commented 8 years ago

Thanks for the suggestion @raleighbuckner - it makes sense. Let me have a little think about the best way forward. I'm not against breaking changes, the project uses semantic versioning so we'd have to move to v4.x.x to represent this breaking change. We'd still want the ability to be able to configure the datetime-based toggles to use local datetime or utc with time zone - what do you think?