Skip to content

Commit

Permalink
sparqlEscapeDate should insert a date (#11)
Browse files Browse the repository at this point in the history
Current sparqlEscapeDate inserts a datetime, which is not a valid xsd:date
  • Loading branch information
nvdk authored and erikap committed May 2, 2018
1 parent c667a09 commit b828a82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helpers/mu/sparql.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function sparqlEscapeFloat( value ){
};

function sparqlEscapeDate( value ){
return '"' + new Date(value).toISOString() + '"^^xsd:date';
return '"' + new Date(value).toISOString().substring(0, 10) + '"^^xsd:date'; // only keep 'YYYY-MM-DD' portion of the string
};

function sparqlEscapeDateTime( value ){
Expand Down

0 comments on commit b828a82

Please sign in to comment.