소스 검색

publish_date fix

ganahrhr 4 년 전
부모
커밋
e651c93514
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      Pages/DocsUpload.razor

+ 3 - 2
Pages/DocsUpload.razor

@@ -38,7 +38,8 @@
         MySQLConnector dbCon = MySQLConnector.Instance();
 
         string stringSQL = $"INSERT INTO articles (filename, article_name, authors, date_publish, annotation, keywords)" +
-            $"VALUES ('{articleModel.Filename}', '{articleModel.Name}', '{articleModel.Author}', '{articleModel.PublishDate}', '{articleModel.Annotation}', '{articleModel.Keywords}')";
+            $"VALUES ('{articleModel.Filename}', '{articleModel.Name}', '{articleModel.Author}', '{articleModel.PublishDate.ToString("yyyy-MM-dd")}'," +
+            $"'{articleModel.Annotation}', '{articleModel.Keywords}')";
         long id = dbCon.SQLInsert(stringSQL);
 
         stringSQL = $"INSERT INTO actions_history (article_id, action_type, acc_id)" +
@@ -87,7 +88,7 @@
             articleModel.Author = docFields["authors"];
             articleModel.Keywords = docFields["keywords"];
             articleModel.Annotation = docFields["annotation"];
-            text = docFields["text"];            
+            text = docFields["text"];
         }
     }
 }