0

I need the following Javascript- object in the frontend. Therefore I made a class with the same properties in the backend. My problem now is the startAt date. I don't know which type I should use in backend (JodaTime DateTime is different to javascript Date- object) so that I do not have to convert this startsAt property in the frontend. Is there any possibility or do I have to convert this object in frontend in that way to convert Joda DateTime to Javascript Date object?

{
title: 'My testevent',
startsAt: new Date(2016,7,19,9),
allDay: false,
type: 'SCHEDULE_PRESENCE',
institutionId: '123',
institutionName: 'Zur Weinstrasse',
userId: '321',
userName: 'Hannes Weninger',
userRole: 'USER-ROLE',
color: calendarConfig.colorTypes.warning
}
quma
  • 5,233
  • 26
  • 80
  • 146
  • Why use Joda Time with Java 8 when you have JSR 310? Also, on the JS end, do you know the time zone? – fge Aug 20 '16 at 19:35
  • 1
    How does your data get from the backend to the frontend? How is it serialized? – Yosef Weiner Aug 20 '16 at 19:46
  • I send JSON from backend to frontend by REST- Services. – quma Aug 21 '16 at 05:07
  • Possible duplicate of [How to parse JSON to receive a Date object in JavaScript?](http://stackoverflow.com/questions/4511705/how-to-parse-json-to-receive-a-date-object-in-javascript) – Yosef Weiner Aug 21 '16 at 20:57

0 Answers0