import moment from 'moment';

const DefaultDateFormat = 'YYYY-MM-DD';
const DefaultTimeFormat = 'hh:mm:ss';
const DefaultDateTimeFormat = 'YYYY-MM-DD hh:mm:ss';

export default function renderDate(date, formFormat, displayFormat) {
	let format;
	if (displayFormat) format = displayFormat;
	else if (formFormat === 'time') format = DefaultTimeFormat;
	else if (formFormat === 'dateTime') format = DefaultDateTimeFormat;
	else format = DefaultDateFormat;
	return moment(new Date(date)).format(format);
}

@@ -90,18 +90,18 @@
 rmat = '
-hh
+HH
 :mm:ss';
@@ -147,10 +147,10 @@
 -DD 
-hh
+HH
 :mm:

fix time format bug