wix-router possible Bug: to $date or not to $date? That is the question.

OK folks, has anyone seen this effect when using wix-router?

Wix team not sure this is this a feature or a bug. I am however erring on the side of it being a bug.

I have a date field in a data collection that I want to retrieve in my router and then pass to my page using the [routerReturnedData: Object] parameter of the ok() function.

So I have an object (a raw record from the data collection) which I pass to the ok function.

When I pull the record from the getRouterData() function on my page the record has been miraculously changed. To verify this phenomenon I sent a JSON version of the object along with the actual object from my router and this is what I get:

JSON version of Original Object:


This arrives in an object as follows:

"_updatedDate":{"$date": "2018-07-26T13:31:39.137Z"}}

So basically the Wix api code has (possibly for JSON encoding purposes though it doesn’t appear necessary) adjusted the original record and altered the date fields by turning them into Objects by adding the key “$date”. It has then forgotten to rewind this adjustment when getRouterData() is called :-(.

Cheers Steve

1 Like

Hi WIX team,

I’m observing same issue.
Is it by design or it is indeed bug?
Why passing date from router to front end modifies the date in such a way?


Hi! It’s bug and we are aware about it. I can’t though say when it’s will be fixed…

Hi Mikhail. Thanks for the update!