|
|
@@ -0,0 +1,34 @@
|
|
|
+function formatDate (row, column, value) {
|
|
|
+ if (!value) {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+
|
|
|
+ const date = new Date(value)
|
|
|
+ let str = ''
|
|
|
+ str += date.getFullYear() + '-'
|
|
|
+ if (date.getMonth() + 1 < 10) {
|
|
|
+ str += '0'
|
|
|
+ }
|
|
|
+ str += (date.getMonth() + 1) + '-'
|
|
|
+ if (date.getDate() < 10) {
|
|
|
+ str += '0'
|
|
|
+ }
|
|
|
+ str += date.getDate() + ' '
|
|
|
+ if (date.getHours() < 10) {
|
|
|
+ str += '0'
|
|
|
+ }
|
|
|
+ str += date.getHours() + ':'
|
|
|
+ if (date.getMinutes() < 10) {
|
|
|
+ str += '0'
|
|
|
+ }
|
|
|
+ str += date.getMinutes() + ':'
|
|
|
+ if (date.getSeconds() < 10) {
|
|
|
+ str += '0'
|
|
|
+ }
|
|
|
+ str += date.getSeconds()
|
|
|
+ return str
|
|
|
+}
|
|
|
+
|
|
|
+export {
|
|
|
+ formatDate
|
|
|
+}
|