Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properties of type Date are not parsed #101

Open
ncaprivi opened this issue Mar 24, 2021 · 1 comment
Open

Properties of type Date are not parsed #101

ncaprivi opened this issue Mar 24, 2021 · 1 comment

Comments

@ncaprivi
Copy link

I use graphexp to visualize my JanusGraph database. It supports java.util.Date as vertex property type. But graphexp displays the value as unix timestamp (number). With a small hack, I was able to change infobox.js:

function _display_vertex_properties(key,value,info_table) {
    if (typeof value === "string" && $('#communication_method').val() =="GraphSON3_4"){
	var new_info_row = info_table.append("tr");
 	new_info_row.append("td").text(key).style("font-size",_font_size);
	var formattedValue = value 
	if (key.includes("time")) {
		formattedValue = new Date(parseInt(value)).toLocaleString("en-GB", {timeZone: "Region/City", timeZoneName: "short", hour12: false})
	} 
 	new_info_row.append("td").text(formattedValue).style("font-size",_font_size);
 	new_info_row.append("td").text('').style("font-size",_font_size);
    }

This would parse the number to a date, each time the property key contains "time".

Anyone has a nice idea for a general, robust solution?

@bricaud
Copy link
Owner

bricaud commented Sep 17, 2023

Hi, thanks for the suggestion. Could you make a PR if you have found a more general solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants