Browse Source

fix(nocodb): sqlite -> sqlite3

pull/5463/head
Wing-Kam Wong 2 years ago
parent
commit
02fd36589d
  1. 18
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/convertDateFormat.ts

18
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/helpers/convertDateFormat.ts

@ -1,22 +1,22 @@
export function convertDateFormat(date_format: string, type: string) { export function convertDateFormat(date_format: string, type: string) {
if (date_format === 'YYYY-MM-DD') { if (date_format === 'YYYY-MM-DD') {
if (type === 'mysql2' || type === 'sqlite') return '%Y-%m-%d'; if (type === 'mysql2' || type === 'sqlite3') return '%Y-%m-%d';
} else if (date_format === 'YYYY/MM/DD') { } else if (date_format === 'YYYY/MM/DD') {
if (type === 'mysql2' || type === 'sqlite') return '%Y/%m/%d'; if (type === 'mysql2' || type === 'sqlite3') return '%Y/%m/%d';
} else if (date_format === 'DD-MM-YYYY') { } else if (date_format === 'DD-MM-YYYY') {
if (type === 'mysql2' || type === 'sqlite') return '%d/%m/%Y'; if (type === 'mysql2' || type === 'sqlite3') return '%d/%m/%Y';
} else if (date_format === 'MM-DD-YYYY') { } else if (date_format === 'MM-DD-YYYY') {
if (type === 'mysql2' || type === 'sqlite') return '%d-%m-%Y'; if (type === 'mysql2' || type === 'sqlite3') return '%d-%m-%Y';
} else if (date_format === 'DD/MM/YYYY') { } else if (date_format === 'DD/MM/YYYY') {
if (type === 'mysql2' || type === 'sqlite') return '%d/%m/%Y'; if (type === 'mysql2' || type === 'sqlite3') return '%d/%m/%Y';
} else if (date_format === 'MM/DD/YYYY') { } else if (date_format === 'MM/DD/YYYY') {
if (type === 'mysql2' || type === 'sqlite') return '%m-%d-%Y'; if (type === 'mysql2' || type === 'sqlite3') return '%m-%d-%Y';
} else if (date_format === 'DD MM YYYY') { } else if (date_format === 'DD MM YYYY') {
if (type === 'mysql2' || type === 'sqlite') return '%d %m %Y'; if (type === 'mysql2' || type === 'sqlite3') return '%d %m %Y';
} else if (date_format === 'MM DD YYYY') { } else if (date_format === 'MM DD YYYY') {
if (type === 'mysql2' || type === 'sqlite') return '%m %d %Y'; if (type === 'mysql2' || type === 'sqlite3') return '%m %d %Y';
} else if (date_format === 'YYYY MM DD') { } else if (date_format === 'YYYY MM DD') {
if (type === 'mysql2' || type === 'sqlite') return '%Y %m %d'; if (type === 'mysql2' || type === 'sqlite3') return '%Y %m %d';
} }
// pg / mssql // pg / mssql
return date_format; return date_format;

Loading…
Cancel
Save