This is a migrated thread and some comments may be shown as answers.

"String was not recognized as a valid DateTime" when opening Custom Recurrence dialog

2 Answers 24 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 08 Oct 2020, 06:53 PM

Hi,

 

I am getting the error "String was not recognized as a valid DateTime" when I click on Custom in the recurrence screen. Am I missing a localization setting? My android device is in Pt-Br.

 

In the output windows I can see:

 

10-08 15:49:27.438 E/AppCenterCrashes(24492): Unhandled Exception from source=AndroidEnvironment
10-08 15:49:27.438 E/AppCenterCrashes(24492): System.FormatException: String was not recognized as a valid DateTime.
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at System.DateTimeParse.ParseExact (System.ReadOnlySpan`1[T] s, System.ReadOnlySpan`1[T] format, System.Globalization.DateTimeFormatInfo dtfi, System.Globalization.DateTimeStyles style) [0x00024] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/Common/src/CoreLib/System/Globalization/DateTimeParse.cs:31
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at System.DateTime.ParseExact (System.String s, System.String format, System.IFormatProvider provider) [0x00014] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/Common/src/CoreLib/System/DateTime.cs:1131
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Telerik.XamarinForms.Input.CalendarYearlyViewPicker.DateView_PropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00040] in <8d058a9ae5d34d7aa63e24afe6fbbabc>:0
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:229
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:358
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Telerik.XamarinForms.Input.RecurrencePeriodView.set_IsSelected (System.Boolean value) [0x00017] in <8d058a9ae5d34d7aa63e24afe6fbbabc>:0
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Telerik.XamarinForms.Input.CalendarYearlyViewPicker.SetInitialSelectedChildren (System.Collections.ObjectModel.ObservableCollection`1[T] newValue) [0x00073] in <8d058a9ae5d34d7aa63e24afe6fbbabc>:0
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Telerik.XamarinForms.Input.CalendarYearlyViewPicker.OnSelectedMonthsChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00003] in <8d058a9ae5d34d7aa63e24afe6fbbabc>:0
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:463
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x00214] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:155
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:53
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__49_0 () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:742
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Xamarin.Forms.BindingExpression+BindingExpressionPart.PropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs args) [0x000cb] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:753
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Xamarin.Forms.BindingExpression+WeakPropertyChangedProxy.OnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00012] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:646
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Telerik.XamarinForms.Common.NotifyPropertyChangedBase.OnPropertyChanged (System.String propertyName) [0x00015] in <204e483098f14490aba225eef00b07db>:0
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Telerik.XamarinForms.Input.Calendar.CustomRecurrenceViewModel.set_SelectedMonthsOfYear (System.Collections.ObjectModel.ObservableCollection`1[T] value) [0x00010] in <8d058a9ae5d34d7aa63e24afe6fbbabc>:0
10-08 15:49:27.438 E/AppCenterCrashes(24492):   at Telerik.Xamar

2 Answers, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 09 Oct 2020, 06:25 AM

Hi Daniel,

I changed the device culture to Pr-Br, click on the custom recurrence dialog, and no issues on my side. Maybe I am missing something. Could you please elaborate more on the behavior and what are the exact steps to reproduce the issue? 

I look forward to your reply.

Regards,
Didi
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Daniel
Top achievements
Rank 1
answered on 09 Oct 2020, 11:47 AM

Hi, Didi

I found out that the problem was with Calendar_MonthAbbreviation* strings in the resource file. The custom recurrence view only works with the English strings. Probably is not using the current culture in the TryParse method.

 

Thank you again.

Tags
Calendar & Scheduling
Asked by
Daniel
Top achievements
Rank 1
Answers by
Didi
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or