|
7 | 7 | from dtable_events.dtable_io.excel import parse_row, write_xls_with_type, TEMP_EXPORT_VIEW_DIR, IMAGE_TMP_DIR |
8 | 8 | from dtable_events.dtable_io.utils import get_related_nicknames_from_dtable, get_metadata_from_dtable_server, \ |
9 | 9 | escape_sheet_name |
10 | | -from dtable_events.utils import get_location_tree_json, gen_random_option, format_date |
| 10 | +from dtable_events.utils import get_location_tree_json, gen_random_option, format_date_in_query |
11 | 11 | from dtable_events.utils.constants import ColumnTypes |
12 | 12 | from dtable_events.app.config import INNER_DTABLE_DB_URL, BIG_DATA_ROW_IMPORT_LIMIT, BIG_DATA_ROW_UPDATE_LIMIT, \ |
13 | 13 | ARCHIVE_VIEW_EXPORT_ROW_LIMIT, APP_TABLE_EXPORT_EXCEL_ROW_LIMIT, INNER_DTABLE_SERVER_URL |
@@ -104,7 +104,7 @@ def handle_excel_row_datas(db_api, table_name, excel_row_datas, ref_cols, column |
104 | 104 | if column_name_type_map.get(col) and column_name_type_map.get(col) == ColumnTypes.DATE: |
105 | 105 | pre_format_date_str = base_row.get(col).replace('T', ' ') |
106 | 106 | pre_format_date_str = pre_format_date_str.split('+' if '+' in pre_format_date_str else '-')[0] |
107 | | - base_ref_data[col] = format_date(pre_format_date_str, column_name_data_map.get(col).get('format')) |
| 107 | + base_ref_data[col] = format_date_in_query(pre_format_date_str, column_name_data_map.get(col).get('format')) |
108 | 108 | if base_ref_data and excel_ref_data and base_ref_data == excel_ref_data: |
109 | 109 | rows_for_update.append({ |
110 | 110 | "row_id": base_row.get('_id'), |
@@ -374,7 +374,7 @@ def update_excel_to_db( |
374 | 374 | pop_col_lists.append(col_name) |
375 | 375 | continue |
376 | 376 | elif col_type == ColumnTypes.DATE and col_data: |
377 | | - row_data[col_name] = format_date(str(value), col_data.get('format')) |
| 377 | + row_data[col_name] = format_date_in_query(str(value), col_data.get('format')) |
378 | 378 |
|
379 | 379 | row_data1 = deepcopy(row_data) |
380 | 380 | for col_name in pop_col_lists: |
|
0 commit comments