我正在用图表js绘制json图。即使我将格式设置为日期,我仍然会获得时间戳。我希望有一个人可以帮助我。顺便说一句,正在从Firebase检索数据。我附上我正在使用的代码。
谢谢。
所需的输出:
代码:
false
我从Firebase获取数据
write_data([]).
write_data([X]) :-
/*!,*/write('LAST!'),nl.
write_data([X | Rest]) :-
dif(Rest,[]),/**/
write(x),nl,write_data(Rest).
我将其格式化为MMDDYYYY
var currentDate= val.date; //Extracting the date value in dd/mm/yyyy format from the mentioned text box
然后将其更改为日期数据类型
//Printing the extracted date value before making the change
var newDate = currentDate.split('/'); //Splitting the extracted date value using the delimiter /,which is the seperator used in the date value
currentDate = newDate[1] + "/" + newDate[0] + "/" + newDate[2];//Constructing a new date value (string) using the splitted values.
我将所有更改后的数据添加到用于绘制数据的数组中
var dateObject = new Date(currentDate);