From 5bb5b714e22fa39c7fd915e2c26408fe218393a2 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 15 Aug 2019 22:46:21 +0800 Subject: [PATCH] Display ui time with customize time location (#7792) * display ui time with customize time location * fix lint * rename UILocation to DefaultUILocation * move time related functions to modules/timeutil * fix tests * fix tests * fix build * fix swagger --- doc/advanced/config-cheat-sheet.en-us.md | 6 +++++- doc/advanced/config-cheat-sheet.zh-cn.md | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/advanced/config-cheat-sheet.en-us.md b/doc/advanced/config-cheat-sheet.en-us.md index 3c6a306b..ac309cec 100644 --- a/doc/advanced/config-cheat-sheet.en-us.md +++ b/doc/advanced/config-cheat-sheet.en-us.md @@ -503,8 +503,12 @@ Two special environment variables are passed to the render command: - `GITEA_PREFIX_SRC`, which contains the current URL prefix in the `src` path tree. To be used as prefix for links. - `GITEA_PREFIX_RAW`, which contains the current URL prefix in the `raw` path tree. To be used as prefix for image paths. +## Time (`time`) +- `FORMAT`: Time format to diplay on UI. i.e. RFC1123 or 2006-01-02 15:04:05 +- `DEFAULT_UI_LOCATION`: Default location of time on the UI, so that we can display correct user's time on UI. i.e. Shanghai/Asia + ## Other (`other`) - `SHOW_FOOTER_BRANDING`: **false**: Show Gitea branding in the footer. - `SHOW_FOOTER_VERSION`: **true**: Show Gitea version information in the footer. -- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: **true**: Show time of template execution in the footer. +- `SHOW_FOOTER_TEMPLATE_LOAD_TIME`: **true**: Show time of template execution in the footer. \ No newline at end of file diff --git a/doc/advanced/config-cheat-sheet.zh-cn.md b/doc/advanced/config-cheat-sheet.zh-cn.md index b9a16dd8..7a00216b 100644 --- a/doc/advanced/config-cheat-sheet.zh-cn.md +++ b/doc/advanced/config-cheat-sheet.zh-cn.md @@ -237,7 +237,9 @@ IS_INPUT_FILE = false - RENDER_COMMAND: 工具的命令行命令及参数。 - IS_INPUT_FILE: 输入方式是最后一个参数为文件路径还是从标准输入读取。 - +## Time (`time`) +- `FORMAT`: 显示在界面上的时间格式。比如: RFC1123 或者 2006-01-02 15:04:05 +- `DEFAULT_UI_LOCATION`: 默认显示在界面上的时区,默认为本地时区。比如: Asia/Shanghai ## Other (`other`)