Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pranshugupta54 committed Oct 10, 2024
1 parent fcc0c38 commit f210aab
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/services/database_mutation_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ class DataBaseMutationFunctions {
String mutation, {
Map<String, dynamic>? variables,
}) async {
if (variables != null) {
traverseAndConvertDates(variables, convertLocalToUTC, splitDateTimeUTC);
}
if (variables != null) {
traverseAndConvertDates(variables, convertLocalToUTC, splitDateTimeUTC);
}
final MutationOptions options = MutationOptions(
document: gql(mutation),
variables: variables ?? <String, dynamic>{},
Expand Down
6 changes: 3 additions & 3 deletions lib/services/event_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ class EventService extends BaseFeedManager<Event> {
}

print(result.data!["eventsByOrganizationConnection"]);
final eventsJson = result
.data!["eventsByOrganizationConnection"] as List<dynamic>;
final eventsJson =
result.data!["eventsByOrganizationConnection"] as List<dynamic>;
eventsJson.forEach((eventJsonData) {
final Event event = Event.fromJson(eventJsonData as Map<String,dynamic>);
final Event event = Event.fromJson(eventJsonData as Map<String, dynamic>);
event.isRegistered = event.attendees?.any(
(attendee) => attendee.id == _userConfig.currentUser.id,
) ??
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/time_conversion.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Map<String, String> splitDateTimeUTC(String dateTimeStr) {
'time': DateFormat('HH:mm:ss.SSS\'Z\'').format(dateTime),
};
}

Map<String, String> splitDateTimeLocal(String dateTimeStr) {
final DateTime dateTime = DateTime.parse(dateTimeStr);
return {
Expand All @@ -35,7 +36,6 @@ void traverseAndConvertDates(
Map<String, String> Function(String) splitFn,
) {
obj.forEach((key, value) {

final pairedFields =
dateTimeFields['pairedFields']?.cast<Map<String, String>>();
if (pairedFields != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,8 @@ class CreateEventViewModel extends BaseModel {
'startTime': isAllDay
? null
: '${DateFormat('HH:mm:ss').format(startTime)}',
'endTime': isAllDay
? null
: '${DateFormat('HH:mm:ss').format(endTime)}',
'endTime':
isAllDay ? null : '${DateFormat('HH:mm:ss').format(endTime)}',
},
if (isRecurring)
'recurrenceRuleData': {
Expand Down

0 comments on commit f210aab

Please sign in to comment.