-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Fix comment's created at wrong timezone #460
Conversation
@beagleknight, thanks for your PR! By analyzing the history of the files in this pull request, we identified @josepjaume to be a potential reviewer. |
@@ -12,7 +12,7 @@ const generateCommentsData = (num = 1) => { | |||
commentsData.push({ | |||
id: random.uuid(), | |||
body: random.words(), | |||
createdAt: date.past().toString(), | |||
createdAt: Math.floor(date.past().getTime() / 1000), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use ISO8901 format instead. Should work seamlessly with moment.parse
.
89f2589
to
5e3c9ca
Compare
Current coverage is 96.93% (diff: 100%)@@ master #460 diff @@
==========================================
Files 234 234
Lines 3527 3528 +1
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 3419 3420 +1
Misses 108 108
Partials 0 0
|
aedb269
to
e16b9be
Compare
@@ -11,7 +11,9 @@ module Comments | |||
field :body, !types.String, "The comment message" | |||
|
|||
field :createdAt, !types.String, "The creation date of the comment" do | |||
property :created_at | |||
resolve lambda { |obj, _args, _ctx| | |||
obj.created_at.to_time.iso8601 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to time? Wouldn't it be better to use seconds from epoch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure... I found that as an example but I think I can use the iso8601
method directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
🎩 What? Why?
Comment component was rendering the
createdAt
with an incorrect timezone.📌 Related Issues
📋 Subtasks
None
📷 Screenshots (optional)
None
👻 GIF