Change the popup Date Format to DatePicker

teofilocteofiloc USMember ✭✭

Hi guys,
I am trying to change the popup DatePicker format.
Please see the image.

I need to sow this in Day/Month/Year
Example.

Mon, 25 Sep, 2017

24 Aug 2016

This my xaml:

<DatePicker.Format>d/M/yyyy</DatePicker.Format>
<DatePicker.MinimumDate>


Jan 1 1950


</DatePicker.MinimumDate>

This does't work. it showing Month/Day/Year

Thanks,

Answers

  • teofilocteofiloc USMember ✭✭
     <DatePicker x:Name="installDatePicker"
                        Date="{Binding InstallationDate}"
                        MaximumDate="{x:Static sys:DateTime.Now}"
                        IsVisible="False"
                        VerticalOptions="CenterAndExpand">
                <DatePicker.Format>M/d/yyyy</DatePicker.Format>
                <DatePicker.MinimumDate>
                    <sys:DateTime x:FactoryMethod="Parse">
                        <x:Arguments>
                            <x:String>Jan 1 1950</x:String>
                        </x:Arguments>
                    </sys:DateTime>
                </DatePicker.MinimumDate>
            </DatePicker>
    
  • teofilocteofiloc USMember ✭✭

    Thanks for you help, but this keep showing Month Day Year.

     <DatePicker x:Name="warrantyDatePicker"
                        Date="{Binding WarrantyExpirationDate}"
                        IsVisible="False"
                        VerticalOptions="CenterAndExpand">
                <DatePicker.Format>dd/MM/yyyy</DatePicker.Format>
                <DatePicker.MinimumDate>
                    <sys:DateTime x:FactoryMethod="Parse">
                        <x:Arguments>
                            <x:String>Jan 1 1950</x:String>
                        </x:Arguments>
                    </sys:DateTime>
                </DatePicker.MinimumDate>
                <DatePicker.MaximumDate>
                    <sys:DateTime x:FactoryMethod="Parse">
                        <x:Arguments>
                            <x:String>Jan 1 2050</x:String>
                        </x:Arguments>
                    </sys:DateTime>
                </DatePicker.MaximumDate>
            </DatePicker>
    
  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    DId you try other formatting options?
    <DatePicker.Format>dd-MM-yyyy</DatePicker.Format>
    With hyphens instead of slashes?

    Did you try changing the culture or formatting at the OS level?
    If you change the preferred date format in the device settings control panel, is that the format used for the Picker?

  • teofilocteofiloc USMember ✭✭

    I will try.

  • teofilocteofiloc USMember ✭✭

    I changed My PC date format to dd-MM-yy and I set the Genymotion device timezone to canada and 31/08/2017 format, but for some reason doesn't work.

  • MaxiPignaMaxiPigna ITMember ✭✭

    @teofiloc I changed the Default Language in the AppManifest from US to IT and it changed the format in ddMMyy.

Sign In or Register to comment.