-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Conversation
4d69328
to
72dc33d
Compare
72dc33d
to
f8ca115
Compare
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.
First-pass review, looks like we might have some extra changes in here, plus I think we can slim down the UI test code a bit.
@@ -0,0 +1,9 @@ | |||
using System.Globalization; |
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.
Can we change the file name to match the interface name?
@@ -71,7 +71,7 @@ | |||
</Target> | |||
|
|||
<Target Name="_StrongName" AfterTargets="Build" DependsOnTargets="_SetSnExe" Condition="'$(TargetPath)' != ''" Inputs="$(TargetPath)" Outputs="$(IntermediateOutputPath)Sn.stamp"> | |||
<Exec Command='"$(SnExe)" -R $(TargetPath) ..\xamarin.forms.snk' Condition=" '$(SignAssembly)' == 'true' " /> | |||
<Exec Command=""$(SnExe)" -R $(TargetPath) ..\xamarin.forms.snk" Condition=" '$(SignAssembly)' == 'true' " /> |
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.
These changes can probably be reverted.
@@ -5,7 +5,7 @@ | |||
<PropertyGroup> | |||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |||
<iOSPlatform Condition=" '$(iOSPlatform)' == '' ">iPhone</iOSPlatform> | |||
<Platform Condition=" '$(Platform)' == '' ">$(iOSPlatform)</Platform> | |||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform> |
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.
Was this change intentional?
// DatePicker Format String: d, M, y | ||
// Separator: "/" | ||
[Test] | ||
public void DatePickerOneDigit() |
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.
It looks like several of these tests follow the same general format - would it be possible to use the TestCase attribute and create fewer test methods?
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.
A couple more things.
@@ -160,7 +162,31 @@ void UpdateDateFromModel(bool animate) | |||
if (_picker.Date.ToDateTime().Date != Element.Date.Date) | |||
_picker.SetDate(Element.Date.ToNSDate(), animate); | |||
|
|||
Control.Text = Element.Date.ToString(Element.Format); | |||
//can't use Element.Format because it won't display the correct format if the region and language are set differently | |||
if (Element.Format.Equals("") || Element.Format.Equals("d") || Element.Format.Equals("D")) |
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.
Do you think we should use something like string.IsNullOrWhitespace
instead of .Equals("")
?
I think the issue #11520 still exists after this PR. On UWP I tried using "HH:mm" but it does not use a leading 0 in the picker or in the display of the selected value: I think the format the UWP picker is displaying is "H:mm". |
1c7bf16
to
ca5c809
Compare
597c872
to
e10cca9
Compare
Description of Change
The Format property of the DatePicker and TimePicker creates consistent changes of the date and time displays. Also, the DatePicker format is consistent with the iOS default for specific region and language settings.
Issues Resolved
API Changes
None
Platforms Affected
Behavioral/Visual Changes
The DatePicker and TimePicker displays and pickers might change depending on the format property as well as the regional settings.
Before/After Screenshots
Before:
After:
Testing Procedure
Create DatePicker and TimePickers on Android, iOS, and UWP and play around with different format properties as well as different regional settings to see if the date and time picker displays and picker stay consistent and follow the region's culture default format for date and time respectively
PR Checklist