Skip to content

Commit 98a9195

Browse files
authored
Revert "Fix error when choose noon on time picker (flutter#78478)" (flutter#79828)
This reverts commit 6dd77cc as it is breaking the build.
1 parent aa90210 commit 98a9195

2 files changed

Lines changed: 1 addition & 20 deletions

File tree

packages/flutter/lib/src/material/time.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class TimeOfDay {
9191
DayPeriod get period => hour < hoursPerPeriod ? DayPeriod.am : DayPeriod.pm;
9292

9393
/// Which hour of the current period (e.g., am or pm) this time is.
94-
int get hourOfPeriod => hour > hoursPerPeriod ? hour - periodOffset : hour;
94+
int get hourOfPeriod => hour - periodOffset;
9595

9696
/// The hour at which the current period starts.
9797
int get periodOffset => period == DayPeriod.am ? 0 : hoursPerPeriod;

packages/flutter/test/material/time_test.dart

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,5 @@ void main() {
2525
expect(await pumpTest(false), '7:00 AM');
2626
expect(await pumpTest(true), '07:00');
2727
});
28-
29-
testWidgets('return 12 hours at noon', (WidgetTester tester) async {
30-
Future<String> pumpTest(bool alwaysUse24HourFormat) async {
31-
late String formattedValue;
32-
await tester.pumpWidget(MaterialApp(
33-
home: MediaQuery(
34-
data: MediaQueryData(alwaysUse24HourFormat: alwaysUse24HourFormat),
35-
child: Builder(builder: (BuildContext context) {
36-
formattedValue = const TimeOfDay(hour: 12, minute: 0).format(context);
37-
return Container();
38-
}),
39-
),
40-
));
41-
return formattedValue;
42-
}
43-
44-
expect(await pumpTest(false), '12:00 PM');
45-
expect(await pumpTest(true), '12:00');
46-
});
4728
});
4829
}

0 commit comments

Comments
 (0)