Skip to content

Commit

Permalink
sharpen javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
OlliL committed Sep 19, 2024
1 parent 34407ac commit 4a570f2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/tools/PiniaUtil.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
/**
* Pinia uses per default JSON.parse as deserializer.
* Unfortunally Date gets serialized as UTC timezoned string.
* JSON.parse just restores it as string which renders it useless because the code working with the affected properties treats them as Date objects.
* pinia-plugin-persistedstate uses JSON.stringify as serializer and JSON.parse as deserializer per default.
*
* Because of that, a Date object gets serialized as an UTC timezoned string.
*
* During deserialization, JSON.parse just restores it as string which renders it useless because the code working with the affected properties treats them as Date objects.
*
* JSON.parse can also receive a reviver which can be used to parse those UTC timezoned date strings and finally dezerializes them as propper Date objects.
*
Expand Down

0 comments on commit 4a570f2

Please sign in to comment.