mirror of https://github.com/nocodb/nocodb
Wing-Kam Wong
2 years ago
45 changed files with 407 additions and 142 deletions
@ -0,0 +1,17 @@
|
||||
<script lang="ts" setup> |
||||
import { CellClickHookInj, CurrentCellInj, createEventHook, ref } from '#imports' |
||||
|
||||
const el = ref() |
||||
|
||||
const cellClickHook = createEventHook() |
||||
|
||||
provide(CellClickHookInj, cellClickHook) |
||||
|
||||
provide(CurrentCellInj, el) |
||||
</script> |
||||
|
||||
<template> |
||||
<div ref="el" class="select-none" @click="cellClickHook.trigger($event)"> |
||||
<slot /> |
||||
</div> |
||||
</template> |
@ -0,0 +1,23 @@
|
||||
export function convertDateFormat(date_format: string, type: string) { |
||||
if (date_format === 'YYYY-MM-DD') { |
||||
if (type === 'mysql2' || type === 'sqlite3') return '%Y-%m-%d'; |
||||
} else if (date_format === 'YYYY/MM/DD') { |
||||
if (type === 'mysql2' || type === 'sqlite3') return '%Y/%m/%d'; |
||||
} else if (date_format === 'DD-MM-YYYY') { |
||||
if (type === 'mysql2' || type === 'sqlite3') return '%d/%m/%Y'; |
||||
} else if (date_format === 'MM-DD-YYYY') { |
||||
if (type === 'mysql2' || type === 'sqlite3') return '%d-%m-%Y'; |
||||
} else if (date_format === 'DD/MM/YYYY') { |
||||
if (type === 'mysql2' || type === 'sqlite3') return '%d/%m/%Y'; |
||||
} else if (date_format === 'MM/DD/YYYY') { |
||||
if (type === 'mysql2' || type === 'sqlite3') return '%m-%d-%Y'; |
||||
} else if (date_format === 'DD MM YYYY') { |
||||
if (type === 'mysql2' || type === 'sqlite3') return '%d %m %Y'; |
||||
} else if (date_format === 'MM DD YYYY') { |
||||
if (type === 'mysql2' || type === 'sqlite3') return '%m %d %Y'; |
||||
} else if (date_format === 'YYYY MM DD') { |
||||
if (type === 'mysql2' || type === 'sqlite3') return '%Y %m %d'; |
||||
} |
||||
// pg / mssql
|
||||
return date_format; |
||||
} |
Loading…
Reference in new issue