HTML5 Data Bindings Formatter Support Product Page

Solved

how can I get epoch time to work? It does not convert my time properly.

Reported 03 Feb 2014 01:40:01
1
has this problem
03 Feb 2014 01:40:01 Steven Milo posted:
I can get the formatter to change other date formats, just not from epoch time.

Replies

Replied 03 Feb 2014 11:22:14
03 Feb 2014 11:22:14 Teodor Kuduschiev replied:
Hello Steven,

When using UNIX timestamp format, please first apply the "toNumber" filter, and then the Date filter.
Replied 03 Feb 2014 20:33:53
03 Feb 2014 20:33:53 Steven Milo replied:
I did the toNumber, and the put the date filter on, now I get a blank page. The response is already a number 1391458080462

any ideas?

thanks
Replied 04 Feb 2014 10:10:28
04 Feb 2014 10:10:28 Teodor Kuduschiev replied:
Hello Steven,

The response is a string, that's why it first need a toNumber filter.
Please paste the code generated by the formatter, after the two formats are applied on the date.
Replied 04 Feb 2014 15:53:17
04 Feb 2014 15:53:17 Steven Milo replied:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="ScriptLibrary/jquery-latest.pack.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataBindings.js"></script>
<script type="text/javascript" src="ScriptLibrary/dmxDataSet.js"></script>
<script type="text/javascript">
/* dmxDataSet name "timetest" */
jQuery.dmxDataSet(
{"id": "timetest", "url": "ScriptLibrary/FlightScript/FlightSearch.json", "dataSourceType": "local", "dataType": "json"}
);
/* END dmxDataSet name "timetest" */
</script>
<script type="text/javascript" src="ScriptLibrary/dmxDataFilters.js"></script>
</head>

<body>

<div data-binding-id="repeat1" data-binding-repeat="{{timetest.response.itineraries}}">{{generatedDate.toNumber( ).formatDate( "dd-MM-yyyy HH:mm" )}}</div>
</body>
</html>
Replied 04 Feb 2014 16:37:37
04 Feb 2014 16:37:37 Teodor Kuduschiev replied:
Can you also provide a link to your page?
This reply was removed on 2/7/2014 6:08:49 PM.
See the changelog
Replied 05 Feb 2014 10:21:45
05 Feb 2014 10:21:45 Teodor Kuduschiev replied:
Hi Steve,
Seems your date is not a proper unix timestamp. It is in milliseconds instead of seconds ( en.wikipedia.org/wiki/Unix_time )... so you need to divide by 1000 first.
Also - some of your records do not have generatedDate.
This reply was removed on 2/5/2014 2:50:54 PM.
See the changelog
Replied 05 Feb 2014 14:58:49
05 Feb 2014 14:58:49 Steven Milo replied:
How would I do this with your filter? thanks
Replied 06 Feb 2014 10:38:57
06 Feb 2014 10:38:57 Teodor Kuduschiev replied:
Hello,
You can divide by 1000 in the Format Field that appears when you open the Data Bindings Formatter - just enter /1000 there.
Replied 06 Feb 2014 17:35:48
06 Feb 2014 17:35:48 Steven Milo replied:
OK, Did that. The /1000 works, the convert to number works, but when the format date is applied, the whole page shows no return. Tried to apply it with or without the "toNumber".

Replied 06 Feb 2014 18:44:32
06 Feb 2014 18:44:32 Teodor Kuduschiev replied:

Hi, it seems that this time is not present for each of your records. which seems to cause the issue. Please try using this code only:
{{(inboundInfo.departureTime /1000).toNumber( ).formatDate( "dd-MM-yyyy HH:mm" ) : "not set!"}}

Replied 06 Feb 2014 19:08:27
06 Feb 2014 19:08:27 Steven Milo replied:
Still does not work
Replied 07 Feb 2014 11:09:34
07 Feb 2014 11:09:34 Teodor Kuduschiev replied:
I downloaded your json file and tested this locally. This code works fine:

{{inboundInfo.departureTime ? (inboundInfo.departureTime /1000).toNumber( ).formatDate( "dd-MM-yyyy HH:mm" ) : "not set"}}

Replied 07 Feb 2014 16:58:48
07 Feb 2014 16:58:48 Steven Milo replied:
can you send me the code you have on the html page, as it still does not work for me. If you are looking at the json file. I can get the "generatedDate" to work but not the tree level below ex. "inboundInfo.departureTime".
Page just shows up blank
thanks
Replied 07 Feb 2014 17:06:02
07 Feb 2014 17:06:02 Teodor Kuduschiev replied:
Change the code i sent you, with the one from my latest post on this page, please:
www.getmi.com/dmx/testTime.html
Replied 07 Feb 2014 17:14:47
07 Feb 2014 17:14:47 Steven Milo replied:
Sorry did not work. Not converting the time correctly. All the data shows at least.
1403906100000 converts to this 27-06-2014 17:55
Should be Fri, 27 Jun 2014 21:55:00
Replied 11 Feb 2014 14:59:26
11 Feb 2014 14:59:26 Steven Milo replied:
Sorry did not work. Not converting the time correctly. All the data shows at least.
1403906100000 converts to this 27-06-2014 17:55
Should be Fri, 27 Jun 2014 21:55:00
Replied 11 Feb 2014 15:05:34
11 Feb 2014 15:05:34 Teodor Kuduschiev replied:
Well,
How do you expect it to be Fri, 27 Jun 2014 21:55:00 when your date format is "dd-MM-yyyy HH:mm"? Of course it is converting the date correctly, following the date format you are using.
You can setup the formatter in the format you need: "dd MM yyyy HH:mm:ss", but we do not support date and month names like "monday" or "June"
Replied 11 Feb 2014 15:20:54
11 Feb 2014 15:20:54 Steven Milo replied:
I am not sure what you mean. Just look an the code and my format is h:mma
{inboundInfo.arrivalTime ? (inboundInfo.arrivalTime /1000).toNumber( ).formatDate( "h:mma" ) : "not set"}}

I just want the time.

Check out the 2nd record. returns as 00:23pm how is that formatting properly? I have the unformatted field next to it. Put that into any epoch time converter out there and it returns correctly.
testing.getmi.com/timehelp2.html




Replied 11 Feb 2014 17:03:08
11 Feb 2014 17:03:08 Steven Milo replied:
I see what you were saying on the format. that is not the issue. Not concerned so much on the format as I am with it actually calculating it correctly. What I was pointing out is it is retuning the date incorrectly, not the format.

It is not converting properly.
1403906100000 converts to this 27-06-2014 17:55
Should be 27-06-2014 21:55:00

Replied 12 Feb 2014 15:16:53
12 Feb 2014 15:16:53 Steven Milo replied:
Any word on this?
Replied 13 Feb 2014 17:55:42
13 Feb 2014 17:55:42 Steven Milo replied:
This is not solved
Replied 05 Mar 2014 10:58:26
05 Mar 2014 10:58:26 Teodor Kuduschiev replied:
The UNIX time format is using UTC (Coordinated Universal Time): en.wikipedia.org/wiki/Coordinated_Universal_Time

The javascript time conversion converts the date/time format to user's Time Zone because of this fact. That's why you see it different.
Replied 05 Mar 2014 14:54:59
05 Mar 2014 14:54:59 Steven Milo replied:
This isn't the issue. this topic says you have a problem and needs to be corrected. The timezone difference would not output 00:23pm. There is no such time in any timezone.

I found this topic that says it will be fixed in the next release. Whenever that is.

www.dmxzone.com/support/22124/topic/59159/

Reply to this topic