MicrosoftDocs / appcenter-docs

content repo for Visual Studio App Center on docs.microsoft.com
https://docs.microsoft.com/appcenter/
Creative Commons Attribution 4.0 International
122 stars 320 forks source link

DatePicker not working with ja-JP culture #1241

Closed VikashChauhan51 closed 1 month ago

VikashChauhan51 commented 3 years ago

[Enter feedback here]

DatePicker not working with ja-JP culture:

Following code return digit instead of digit with text: string day=date.Day.ToString(); string year=date.Year.ToString();

Current result: day =14 year=2021

Expected result: day =14日 year=2021年

Verified on Device 📱 8

Document details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

VikashChauhan51 commented 3 years ago

Here two issues with sample code:

First: Following code return digit instead of digit with text:

     string day=date.Day.ToString();
     string year=date.Year.ToString();

Second: we need to swipe the "inComponent" for day 1->2, month 0->1 and year 2->0 with following hake:

   app.Query(x => x.Class("UIPickerView").Invoke("selectRow", date.Day, "inComponent", 1, "animated", true));
    app.Tap(day);

    app.Query(x => x.Class("UIPickerView").Invoke("selectRow", date.Year, "inComponent", 2, "animated", true));
    app.Tap(year);

//Hake for ja-JP culture specific text

 year = date.ToString("Y").Replace(month, string.Empty);
 day = date.ToString("M").Replace(month, string.Empty);

Note: Verified on iphone8

@lucen-ms please help to provide a robust solution which will work with all supported cultures.

DmitriyKirakosyan commented 1 month ago

Closing as stale.