File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11import { CommentsFilterOption } from '@codesandbox/common/lib/types' ;
22import { CodeReference , CommentFragment } from 'app/graphql/types' ;
33import { Action , AsyncAction } from 'app/overmind' ;
4+ import { utcToZonedTime } from 'date-fns-tz' ;
45
56import { OPTIMISTIC_COMMENT_ID } from './state' ;
67
@@ -194,7 +195,7 @@ export const createComment: AsyncAction = async ({ state, effects }) => {
194195
195196 const id = OPTIMISTIC_COMMENT_ID ;
196197 const sandboxId = state . editor . currentSandbox . id ;
197- const now = new Date ( ) . toString ( ) ;
198+ const now = utcToZonedTime ( new Date ( ) . toISOString ( ) , 'Etc/UTC' ) ;
198199 let codeReference : CodeReference | null = null ;
199200 const selection = state . live . currentSelection ;
200201 if ( selection ) {
@@ -281,7 +282,7 @@ export const addComment: AsyncAction<{
281282
282283 const id = OPTIMISTIC_COMMENT_ID ;
283284 const sandboxId = state . editor . currentSandbox . id ;
284- const now = new Date ( ) . toString ( ) ;
285+ const now = utcToZonedTime ( new Date ( ) . toISOString ( ) , 'Etc/UTC' ) ;
285286 const comments = state . comments . comments ;
286287
287288 if ( ! comments [ sandboxId ] ) {
You can’t perform that action at this time.
0 commit comments