I think sticking to a date string is the safest thing to do. Especially if you use iso yyyy-mm-dd because the database indexes are predix based and are able to sort and build ranges. So you don't loose much. The problem is regarding the conceptually incompatible offset and #asDate. #asDate just cuts off minutes hours and seconds from am DateAndTime. So if the offset has a startDate of yesterday asDate will give a date yesterday. In my code I either use "asLocal asDate" or date as string. No better solution so far
Am 04.03.2017 um 12:15 schrieb Sabine Manaa <manaa.sabine@gmail.com>:
Hi Hilaire,
it is interesting to see your posts and having similar topics as me when starting to use voyage. I ended up with saving ZTimestamps. But I will think about storing strings too, because this is more readable when having direct look into mongo. There was a discussion in slack a few days ago (February, 21st) about saving Dates in voyage.
Regards Sabine
2017-03-04 11:21 GMT+01:00 HilaireFernandes [via Smalltalk] <[hidden email]>:
Concerning this problem, one option I found is to get far away of the Voyage/Mongo Date/DateAndTime representation/conversion and stick to string, not really efficience, but well...
mongoBirthday <mongoDescription> ^ VOToOneDescription new attributeName: 'birthday'; accessor: (MAPluggableAccessor read: [:person | person birthday ifNotNil: [person birthday yyyymmdd]] write: [:person :string |string ifNotNil: [person birthday: string asDate]]); yourself
Le 03/03/2017 à 21:12, Hilaire a écrit :
Not sure it is related to this: http://forum.world.st/Possible-bug-with-Voyage-Mongo-date-tt4735597.html
-- Dr. Geo http://drgeo.eu
If you reply to this email, your message will be added to the discussion below: http://forum.world.st/Voyage-and-Date-tp4937235p4937262.html To start a new topic under Pharo Smalltalk Users, email [hidden email] To unsubscribe from Pharo Smalltalk Users, click here. NAML
View this message in context: Re: Voyage and Date Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.