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

don't offer dates for recipe history, only timestamps #79

Merged
merged 2 commits into from
Jun 10, 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
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,17 @@
import graphql.kickstart.tools.GraphQLResolver;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;

@Component
public class PlannedRecipeHistoryResolver implements GraphQLResolver<PlannedRecipeHistory> {

public LocalDate plannedDate(PlannedRecipeHistory history) {
return plannedAt(history).toLocalDate();
}

public OffsetDateTime plannedAt(PlannedRecipeHistory history) {
return history.getPlannedAt()
.atOffset(ZoneOffset.UTC);
}

public LocalDate doneDate(PlannedRecipeHistory history) {
return doneAt(history).toLocalDate();
}

public OffsetDateTime doneAt(PlannedRecipeHistory history) {
return history.getDoneAt()
.atOffset(ZoneOffset.UTC);
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/graphqls/library.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ type PlannedRecipeHistory implements Node {
owner: User!
status: PlanItemStatus!
plannedAt: DateTime!
plannedDate: Date!
doneAt: DateTime!
doneDate: Date!
rating: Rating
ratingInt: PositiveInt
notes: String
Expand Down
Loading