Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evently bugs #2480

Merged
merged 3 commits into from
Aug 2, 2024
Merged
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
13 changes: 11 additions & 2 deletions evently/lib/screens/detail_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class _DetailsScreenState extends State<DetailsScreen> {
if (_validateDates(provider)) {
createEventViewModel.nextPage();
} else {
_showSnackBarWithPostFrameCallback('End date cannot be before start date!');
_showSnackBarWithPostFrameCallback('End of event cannot be before start of event!');
}
},
onPressSaveDraft: () {
Expand All @@ -192,7 +192,7 @@ class _DetailsScreenState extends State<DetailsScreen> {
uploadStep: UploadStep.detail,
);
} else {
_showSnackBarWithPostFrameCallback('End date cannot be before start date!');
_showSnackBarWithPostFrameCallback('End of event cannot be before start of event!');
}
},
isContinueEnable: provider.startDate.isNotEmpty &&
Expand Down Expand Up @@ -258,6 +258,15 @@ class _DetailsScreenState extends State<DetailsScreen> {
if (end.isBefore(start)) {
return false; // End date is before start date
}
// Check times if the dates are the same
if (provider.startDate.compareTo(provider.endDate) == 0) {
final DateTime startTime = DateFormat('HH:mm').parse(provider.startTime);
final DateTime endTime = DateFormat('HH:mm').parse(provider.endTime);

if (endTime.isBefore(startTime)) {
return false; // End time is before start time on the same day
}
}
} catch (e) {
return false; // Invalid date format
}
Expand Down
2 changes: 1 addition & 1 deletion evently/lib/screens/overview_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class _OverViewScreenState extends State<OverViewScreen> {
onTap: () => provider.pickThumbnail(),
child: Container(
width: double.infinity,
height: 180,
height: 200,
padding: EdgeInsets.symmetric(vertical: 20.w),
child: Column(
children: [
Expand Down
4 changes: 2 additions & 2 deletions evently/lib/screens/price_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ class _PriceScreenState extends State<PriceScreen> {
isContinueEnable: provider.isFreeDrop == FreeDrop.unselected
? false
: provider.isFreeDrop == FreeDrop.yes
? provider.numberOfTickets > 0
: provider.numberOfTickets > 0 && provider.price > 0,
? (provider.numberOfTickets > 0 && provider.numberOfTickets <= 1000)
: (provider.numberOfTickets > 0 && provider.numberOfTickets <= 1000 && provider.price > 0),
),
)
],
Expand Down
Loading