Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## [61.5.2]
- [DateAndTimePicker][DatePicker][HorizontalInlineDatePicker] Fixed issue where the default value of pickers with no set value was reused and never updated until restart.

## [61.5.1]
- [Touch][iOS] Fixed scroll gestures on tappable rows getting stuck after dismissing context menus or picker popovers, and prevented taps behind open overlays from activating touch commands.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ public partial class DateAndTimePicker
public static readonly BindableProperty SelectedDateTimeProperty = BindableProperty.Create(
nameof(SelectedDateTime),
typeof(DateTime),
typeof(DateAndTimePicker),
DateTime.Now,
typeof(DateAndTimePicker),
default(DateTime),
defaultBindingMode:BindingMode.TwoWay,
propertyChanged: (bindable, _, date) =>
{
if(date is not DateTime time)
return;

((DateAndTimePicker)bindable).OnSelectedDateTimeChanged(time);
});
},
// A plain DateTime.Now default value is read only once and then shared by every picker,
// so all pickers showed the same frozen time until app restart. The creator runs once per
// picker, so each picker gets the current time instead.
defaultValueCreator: bindable => DateTime.Now);
Comment on lines +21 to +24

/// <summary>
/// The date people selected from the date picker.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,12 @@ public DateTime? MaximumDate
typeof(DateTime),
typeof(DatePicker),
defaultBindingMode:BindingMode.TwoWay,
defaultValue:DateTime.Now,
propertyChanged: (bindable, _, _) => ((DatePicker)bindable).OnSelectedDateChanged());
defaultValue:default(DateTime),
propertyChanged: (bindable, _, _) => ((DatePicker)bindable).OnSelectedDateChanged(),
// A plain DateTime.Now default value is read only once and then shared by every picker,
// so all pickers showed the same frozen time until app restart. The creator runs once per
// picker, so each picker gets the current time instead.
defaultValueCreator: bindable => DateTime.Now);
Comment on lines +65 to +68

public static readonly BindableProperty SelectedDateCommandProperty = BindableProperty.Create(
nameof(SelectedDateCommand),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ public partial class HorizontalInlineDatePicker
public static readonly BindableProperty SelectedDateProperty = BindableProperty.Create(
nameof(SelectedDate),
typeof(DateTime),
typeof(HorizontalInlineDatePicker), defaultValue: DateTime.Now, BindingMode.TwoWay, propertyChanged: (b, _, _) =>
typeof(HorizontalInlineDatePicker),
defaultValue: default(DateTime),
defaultBindingMode: BindingMode.TwoWay,
propertyChanged: (b, _, _) =>
{
Comment on lines +8 to 12
if (b is not HorizontalInlineDatePicker horizontalInlineDatePicker) return;
horizontalInlineDatePicker.OnSelectedDateChanged();
}) ;
},
// A plain DateTime.Now default value is read only once and then shared by every picker,
// so all pickers showed the same frozen time until app restart. The creator runs once per
// picker, so each picker gets the current time instead.
defaultValueCreator: b => DateTime.Now);

/// <summary>
/// The date that people selected from the horizontal in line date picker.
Expand Down