anderx преди 7 години
родител
ревизия
83b6c9e952
променени са 2 файла, в които са добавени 13 реда и са изтрити 1 реда
  1. 1 1
      src/main/java/com/goafanti/common/model/News.java
  2. 12 0
      src/main/java/com/goafanti/news/bo/PolicyResult.java

+ 1 - 1
src/main/java/com/goafanti/common/model/News.java

@@ -259,7 +259,7 @@ public class News {
 		if (this.createTime == null) {
 			return null;
 		} else {
-			return DateFormatUtils.format(this.createTime, AFTConstants.YYYYMMDD);
+			return DateFormatUtils.format(this.createTime, AFTConstants.YYYYMMDDHHMMSS);
 		}
 	}
 

+ 12 - 0
src/main/java/com/goafanti/news/bo/PolicyResult.java

@@ -2,6 +2,9 @@ package com.goafanti.news.bo;
 
 import java.util.List;
 
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.model.Policy;
 
 public class PolicyResult extends Policy {
@@ -16,4 +19,13 @@ public void setPublishPages(List<String> publishPages) {
 	this.publishPages = publishPages;
 }
 
+
+public String getCreateTimeFormattedDate() {
+	if (super.getCreateTime() == null) {
+		return null;
+	} else {
+		return DateFormatUtils.format(super.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
+	}
+}
+
 }