Skip to content

Commit

Permalink
feat: add relative_time_description property to PlaceReview (#273)
Browse files Browse the repository at this point in the history
* feat: add relative_time_description property to PlaceReview

* add relativeTimeDescription to TestPlaceDetails

* chore: update places_test.go

Reverting to simplified test data committed after this PR was created.

---------

Co-authored-by: Angela Yu <5506675+wangela@users.noreply.github.com>
  • Loading branch information
resi-commits and wangela committed Dec 2, 2023
1 parent 45e07db commit 51148b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions places.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,9 @@ type PlaceReview struct {
// Rating the user's overall rating for this place. This is a whole number, ranging
// from 1 to 5.
Rating int `json:"rating,omitempty"`
// RelativeTimeDescription the time that the review was submitted in text, relative
// to the current time.
RelativeTimeDescription string `json:"relative_time_description,omitempty"`
// Text is the user's review. When reviewing a location with Google Places, text
// reviews are considered optional. Therefore, this field may by empty. Note that
// this field may include simple HTML markup.
Expand Down
4 changes: 2 additions & 2 deletions places_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ func TestPlaceDetails(t *testing.T) {
"Sunday: 12:00 – 8:45 PM"
]
},
"secondary_opening_hours": [
"secondary_opening_hours": [
{
"open_now": true,
"periods": [
Expand Down Expand Up @@ -852,7 +852,7 @@ func TestPlaceDetails(t *testing.T) {
if placeID != resp.PlaceID {
t.Errorf("expected %+v, was %+v", placeID, resp.PlaceID)
}

if !*&resp.ServesDinner {
t.Errorf("Expected ServesDinner to be true")
}
Expand Down

0 comments on commit 51148b6

Please sign in to comment.