Values and format of dates

6 posts, 0 answers
  1. Peter
    Peter avatar
    4 posts
    Member since:
    Sep 2008

    Posted 30 Sep 2015 Link to this post

    The message structure http://docs.telerik.com/platform/backend-services/rest/push-notifications/push-structure mentions ​certain date fields. I cannot find further information about what the expected values and format of dates should be.

     

    It seems that they're expected to be a BSON value which is UTC (which excludes a timezone). And it seems that they're expected in ISO date format but that's just a guess.

     

    Anyone have pointers to further doc?

  2. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 01 Oct 2015 Link to this post

    Hello Peter,

    Thank you for posting to the Telerik Developer Forums.

    Indeed, the Date fields mentioned in the referenced article are referred to as Date and Time fields used in Backend Services as shown here.

    You are right, the dates are expected in ISO-8601 date format and on the server they will be converted (if offset is not already specified in the incoming date) to the YYYY-MM-DDTHH:mm:ss.mmm-offset format.

    Let me know if you have further questions.

    Regards,
    Anton Dobrev
    Telerik
     
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
     
  3. Peter
    Peter avatar
    4 posts
    Member since:
    Sep 2008

    Posted 01 Oct 2015 in reply to Anton Dobrev Link to this post

    Anton,

     Thanks for the reply.

    I will reconfirm with my QA but it seems that something like

    { "UseLocalTime": true,
      "NotificationDate": "2015-09-28T18:42:39.021+05:30",
    //snip

    fails to send the notification. The response is a success response.

  4. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 02 Oct 2015 Link to this post

    Hello Peter,

    I can confirm that this format for a NotificationDate is a valid one and should be working as expected - schedule a notification that will be sent when the time in the object according to the device's time zone occurs. 

    Could you please specify the payload of the request that creates the notification and the way the push notification looks in the project? You can retrieve the inserted notification object with an HTTP request as shown here.

    Can you receive notifications that are sent immediately?

    I look forward to your reply.

    Regards,
    Anton Dobrev
    Telerik
     
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
     
  5. Peter
    Peter avatar
    4 posts
    Member since:
    Sep 2008

    Posted 06 Oct 2015 in reply to Anton Dobrev Link to this post

    Hi Anton,

    I think I'm a little closer. If I try to send notifications from the Telerik Platform Push Browser and I have no devices, the Platform Push Browser gives me an error "NotificationDate cannot be set before the current moment", even though it's in (my) future. See attached for an example.  If I use a date/time that's in the future for Earth then it schedules the message.

    I can send the same message, if I don't use the user's timezone.

  6. Anton Dobrev
    Admin
    Anton Dobrev avatar
    539 posts

    Posted 08 Oct 2015 Link to this post

    Hi Peter,

    Thank you for specifying this.

    Indeed, there is a validation about this on the server but it does not cover the current number of devices (because it cannot validate how much devices you are going to have in the future). 

    At the current stage, the validation will cut down requests with UseLocalTime set to true that try to schedule a notification which NotificationDate is in the past according to UTC time. This means that if your time zone is -5 hours UTC time, you cannot schedule a notification with a notification date in the next 5 hours ahead of the current time in your time zone. Can you confirm that this is the behavior you encountered?

    I do agree that there are some missing explanations in the docs on this matter which we will address.

    Meanwhile, let me know if you have further questions or suggestions.

    Regards,
    Anton Dobrev
    Telerik
     
    Everlive is now Telerik Backend Services, and is part of the Telerik Platform.
     
Back to Top