diff --git a/apps/automated/src/ui/time-picker/time-picker-tests.ts b/apps/automated/src/ui/time-picker/time-picker-tests.ts
index e7af6b34c..6de5aafbe 100644
--- a/apps/automated/src/ui/time-picker/time-picker-tests.ts
+++ b/apps/automated/src/ui/time-picker/time-picker-tests.ts
@@ -197,6 +197,13 @@ export class TimePickerTest extends testModule.UITest
+
+
+
+
diff --git a/packages/core/ui/time-picker/time-picker-common.ts b/packages/core/ui/time-picker/time-picker-common.ts
index 92913a3bd..115d84554 100644
--- a/packages/core/ui/time-picker/time-picker-common.ts
+++ b/packages/core/ui/time-picker/time-picker-common.ts
@@ -165,8 +165,11 @@ minuteIntervalProperty.register(TimePickerBase);
export const minuteProperty = new Property({
name: 'minute',
- defaultValue: 0,
+ // avoid defaultValue of 0 because it will prevent valueChanged from firing to initialize value due to it already matching defaultValue to start
+ // sometimes user needs to set 0: https://github.com/NativeScript/NativeScript/issues/10457
+ defaultValue: null,
valueChanged: (picker, oldValue, newValue) => {
+ newValue = newValue || 0;
if (!isMinuteValid(newValue) || !isValidTime(picker)) {
throw new Error(getErrorMessage(picker, 'minute', newValue));
}
@@ -179,8 +182,11 @@ minuteProperty.register(TimePickerBase);
export const hourProperty = new Property({
name: 'hour',
- defaultValue: 0,
+ // avoid defaultValue of 0 because it will prevent valueChanged from firing to initialize value due to it already matching defaultValue to start
+ // sometimes user needs to set 0: https://github.com/NativeScript/NativeScript/issues/10457
+ defaultValue: null,
valueChanged: (picker, oldValue, newValue) => {
+ newValue = newValue || 0;
if (!isHourValid(newValue) || !isValidTime(picker)) {
throw new Error(getErrorMessage(picker, 'Hour', newValue));
}