cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

External Data - Date&Time format

TomasCharvat
14-Alexandrite

External Data - Date&Time format

Hello friends


I need to display data in Chart from static time interval but I cannot solve how to correctly write startDate and endDate.

Date&Time format.png

Can you help me?

 

Thanks for every respond.

 

Tomas

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @TomasCharvat ,

I think this is issue with the converting of the correct data format. Your argument/parameters  here are strings what the QueryNumberPropertyHistory service seems not to "like"

So my suggestion is to create a TWX service where you will convert / parse the string

Example: 

2019-07-17_12-27-42.jpg

so here the code of the TWX service - input parameters max and min as strings.

 

var params = {
	oldestFirst: false /* BOOLEAN */,
	maxItems: 600 /* NUMBER */,
	propertyName: 'sensor' /* STRING */,
	endDate:  undefined /* DATETIME */,
	query: undefined /* QUERY */,
	startDate: undefined /* DATETIME */
};
params.endDate =  parseDate(max, "YYYY-MM-dd HH:mm:ss.SSS Z");
params.startDate =parseDate(min, "YYYY-MM-dd HH:mm:ss.SSS Z");
 
// result: INFOTABLE dataShape: "NumberValueStream"
var result = me.QueryNumberPropertyHistory(params);

 

Then in Vuforia Studio we need to add e.g.  the TestTing custom service getChartDataMinMax

 

2019-07-17_12-40-31.jpg

And we can test then in the preview:

2019-07-17_12-45-53.jpg

View solution in original post

1 REPLY 1

Hi @TomasCharvat ,

I think this is issue with the converting of the correct data format. Your argument/parameters  here are strings what the QueryNumberPropertyHistory service seems not to "like"

So my suggestion is to create a TWX service where you will convert / parse the string

Example: 

2019-07-17_12-27-42.jpg

so here the code of the TWX service - input parameters max and min as strings.

 

var params = {
	oldestFirst: false /* BOOLEAN */,
	maxItems: 600 /* NUMBER */,
	propertyName: 'sensor' /* STRING */,
	endDate:  undefined /* DATETIME */,
	query: undefined /* QUERY */,
	startDate: undefined /* DATETIME */
};
params.endDate =  parseDate(max, "YYYY-MM-dd HH:mm:ss.SSS Z");
params.startDate =parseDate(min, "YYYY-MM-dd HH:mm:ss.SSS Z");
 
// result: INFOTABLE dataShape: "NumberValueStream"
var result = me.QueryNumberPropertyHistory(params);

 

Then in Vuforia Studio we need to add e.g.  the TestTing custom service getChartDataMinMax

 

2019-07-17_12-40-31.jpg

And we can test then in the preview:

2019-07-17_12-45-53.jpg

Top Tags