Hello I am really struggling to make the Split String method work with another method which is double hours.
HtmlElement span = new HtmlElement(SPAN_OPEN, SPAN_CLOSE); span.setValue("Drive Time: "); td.addNestedElement(span); HtmlElement span2 = new HtmlElement(SPAN_OPEN, SPAN_CLOSE); span2.addAttribute("class", "drive_time"); String time=String.valueOf(showSet.getTransferHours()); /*Split the Strings into Hours and Minutes*/ /*var xDate="::";*/ /*alert(xDate.replace(":"," hrs, ").replace(":"," min and ");*/ /*t = Time(double)*/ /*hours(double) = t / 60.0d;*/ /*minutes(int) = t % 60;*/ /*hour = parseInt(arr[0]) + " hr";*/ /*min = parseInt(arr[1]) + " min";*/ DateFormat formatter = null; Date getTransferHours = null; //SimpleDateFormat also allows to include time information e.g. HH:mm String date = "hh:mm"; formatter = new SimpleDateFormat("HH:mm"); getTransferHours = (Date) formatter.parse(date); System.out.println("Date from HH:mm String in Java : " + getTransferHours); span2.setValue((String.indexOf(showSet.getTransferHours()) + " hr " )); /*span2.setValue((String.indexOf(showSet.getTransferHours(min))) + " min" ));*/ td.addNestedElement(span2); tr.addNestedElement(td); return tr;
Any suggestions appreciated.
Thanks,
Michele