Skip to content

Commit

Permalink
Merge pull request #2480 from Pylons-tech/evently-bugs-
Browse files Browse the repository at this point in the history
Evently bugs
  • Loading branch information
MikeSofaer authored Aug 2, 2024
2 parents 9449118 + 1721d68 commit 7f22b54
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
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

0 comments on commit 7f22b54

Please sign in to comment.