generator-begcode
Version:
Spring Boot + Angular/React/Vue in one handy generator
22 lines (21 loc) • 850 B
JavaScript
const generateDateTimeFormat = (language, index, length) => {
let config = ` '${language}': {\n`;
config += ' short: {\n';
config += " year: 'numeric', month: 'short', day: 'numeric', hour: 'numeric', minute: 'numeric'\n";
config += ' },\n';
config += ' medium: {\n';
config += " year: 'numeric', month: 'short', day: 'numeric',\n";
config += " weekday: 'short', hour: 'numeric', minute: 'numeric'\n";
config += ' },\n';
config += ' long: {\n';
config += " year: 'numeric', month: 'long', day: 'numeric',\n";
config += " weekday: 'long', hour: 'numeric', minute: 'numeric'\n";
config += ' }\n';
config += ' }';
if (index !== length - 1) {
config += ',';
}
config += '\n';
return config;
};
export default generateDateTimeFormat;