delight-im / delight-im/Android-DDP

Support for dates (parsing + serializing)

Open
#82 7 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
274
Forks
51
PR merge metrics
No merged PRs in 30d

Description

Meteor stores dates as timestamps in milliseconds. The appropriate Java type would be `long`.

But when a client communicates with the server, the server always sends them in another form and expects them in the same form when it receives data from the client.

What Meteor does is wrapping a plain timestamp such as `1459443366000` in a JSON object containing the date as a property, such as `{ "$date": 1459443366000 }`.

So when you receive a date, the value is not the timestamp itself but the JSON object that you must parse the date from, first.

And when you try to send a date, you can't just put the timestamp right in there but must wrap it in a JSON string, e.g. `myMap.put("myDate", "{ \"$date\": 1459443366000 }");`.

We should add built-in support to make this easier.

Contributor guide

No contributing guide indexed for this repository

Research direction

No files or tests are named in the issue. Start by locating the client’s receive and send serialization entry points, then compare their handling with Meteor’s {$date: milliseconds} representation. Done means dates can be parsed from that object and serialized back into the expected form without manual wrapping.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.