-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Essentials] Add DateTimeOffset overload in Preferences #22815
[Essentials] Add DateTimeOffset overload in Preferences #22815
Conversation
Hey there @Cheesebaron! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Yeah its kind of annoying, but it probably keeps complaining because you have to add it to every txt file for every platform where this API is introduced. |
Do I add it to .Shipped or .Unshipped? |
Unshipped. |
Ah let me fix that |
d33199f
to
38f058c
Compare
I see you are using |
Looking at standard format strings here: https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings
|
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
a1261b1
to
ff0d1c3
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Sorry for the many pushes, I can't build UWP on my machine 😢 |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
No prob, I also do CI driven dev because I am to lazy to boot a windows machine or launch a new devbox. |
Windows is having a few failures: System.InvalidCastException : Invalid cast from 'System.String' to 'System.DateTimeOffset'. Stack trace
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this has a new API, it probably needs to target net9.0 instead.
Gotta fire up my Windows machine to see what is up here. Thanks! I need to figure out what is up with this UnpackagedPreferencesImplementation and why it behaves as it does. |
So seems like DateTime was skipped in the device tests for unpackaged UWP. I've gone ahead and fixed that so that test isn't skipped and made sure DateTimeOffset tests also work. If this is not what you want I can also just skip the DateTimeOffset tests on upackaged UWP. Let me know which direction you want to go. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Looks like the failing pipelines are unrelated to the changes in this PR |
Looking good, now to see what is going on with ci and UI tests |
Not to be pushy, but any chance this gets in before .NET 9 comes out of preview? |
Description of Change
Adds overload in Preferences to store and retrieve DateTimeOffset.
There is no
ToBinary()
method onDateTimeOffset
so I am storing it as a ###string.I have an issue with the roslyn analyzer that checks for PublicAPI, it keeps complaining no matter what I add to either file.~~Issues Fixed
Fixes #22786