Browse Source

DateTime for templates

Vova Tkach 6 years ago
parent
commit
803757ddb0
2 changed files with 10 additions and 0 deletions
  1. 7 0
      engine/fetdata/content.go
  2. 3 0
      hosts/localhost/template/header.html

+ 7 - 0
engine/fetdata/content.go

@@ -26,3 +26,10 @@ func (this *FERData) Content() template.HTML {
 	}
 	return template.HTML("")
 }
+
+func (this *FERData) DateTime() int {
+	if this.Wrap.CurrModule == "index" {
+		return this.DataRow.(*utils.MySql_page).A_datetime
+	}
+	return 0
+}

+ 3 - 0
hosts/localhost/template/header.html

@@ -47,6 +47,9 @@
 				<div><b>RequestURL:</b> {{$.Data.RequestURL}}</div>
 				<div><b>RequestGET:</b> {{$.Data.RequestGET}}</div>
 			</div>
+			<div class="container some-text pt-3">
+				<div><b>DateTime:</b> {{$.Data.DateTime}}</div>
+			</div>
 			<div class="container some-text pt-3">
 				<h2>User</h2>
 				<div><b>UserIsLoggedIn:</b> {{$.Data.UserIsLoggedIn}}</div>