williamspiro / hubXml

A tool to turn any blog into a HubSpot importable XML file
MIT License
14 stars 5 forks source link

Replace / with %2F for dates #27

Closed williamspiro closed 6 years ago

williamspiro commented 6 years ago

Related to https://github.com/williamspiro/hubXml/issues/16

For dates like 15/04/2016, they actually need to be flipped to be 2016/04/15 and the / need to be %2F to hit the api

For the reverse, I used:

String dateToReverse = date.get(0).text().split(", ")[1].split(" -")[0];
String[] s = dateToReverse.split("/");
String dateString = s[2] + "%2F" + s[1] + "%2F" + s[0];
williamspiro commented 6 years ago

Closing via https://github.com/williamspiro/hubXml/pull/28, reverse will need to be done manually for now