diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue13918.xaml b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue13918.xaml
new file mode 100644
index 00000000000..b40172d9b0d
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue13918.xaml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue13918.xaml.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue13918.xaml.cs
new file mode 100644
index 00000000000..6313ca19835
--- /dev/null
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue13918.xaml.cs
@@ -0,0 +1,30 @@
+using System.Collections.Generic;
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+#if UITEST
+using Xamarin.Forms.Core.UITests;
+using Xamarin.UITest;
+using NUnit.Framework;
+#endif
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Github, 13918, "[Bug] iOS DatePicker only displays the last two digits of the year",
+ PlatformAffected.iOS)]
+ public partial class Issue13918 : TestContentPage
+ {
+ public Issue13918()
+ {
+#if APP
+ InitializeComponent();
+#endif
+ }
+
+ protected override void Init()
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
index 371ac8d1f8c..143e27f0c09 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems
@@ -1841,6 +1841,7 @@
+
@@ -2375,6 +2376,9 @@
MSBuild:UpdateDesignTimeXaml
+
+ MSBuild:UpdateDesignTimeXaml
+
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/DatePickerRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/DatePickerRenderer.cs
index 9a0702eb956..92af5537742 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/DatePickerRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/DatePickerRenderer.cs
@@ -166,29 +166,12 @@ void UpdateDateFromModel(bool animate)
{
if (_picker.Date.ToDateTime().Date != Element.Date.Date)
_picker.SetDate(Element.Date.ToNSDate(), animate);
-
- // 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("d") || Element.Format.Equals("D"))
+
+ if (string.IsNullOrWhiteSpace(Element.Format))
{
- NSDateFormatter dateFormatter = new NSDateFormatter
- {
- TimeZone = NSTimeZone.FromGMT(0)
- };
-
- if (Element.Format?.Equals("D") == true)
- {
- dateFormatter.DateStyle = NSDateFormatterStyle.Long;
- var strDate = dateFormatter.StringFor(_picker.Date);
- Control.Text = strDate;
- }
- else
- {
- dateFormatter.DateStyle = NSDateFormatterStyle.Short;
- var strDate = dateFormatter.StringFor(_picker.Date);
- Control.Text = strDate;
- }
+ Control.Text = Element.Date.ToShortDateString();
}
- else if (Element.Format.Contains("/"))
+ else if (Element.Format.Contains('/'))
{
Control.Text = Element.Date.ToString(Element.Format, CultureInfo.InvariantCulture);
}