Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zendata
提交
e584eb28
Z
zendata
项目概览
易企天创
/
zendata
9 个月 前同步成功
通知
17
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zendata
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e584eb28
编写于
9月 14, 2020
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
close date related tasks
上级
5ef701b0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
136 addition
and
2 deletion
+136
-2
demo/test/test_date.yaml
demo/test/test_date.yaml
+40
-0
src/gen/generator.go
src/gen/generator.go
+8
-2
yaml/base/time/date.v1.yaml
yaml/base/time/date.v1.yaml
+44
-0
yaml/base/time/monthday.v1.yaml
yaml/base/time/monthday.v1.yaml
+44
-0
未找到文件。
demo/test/test_date.yaml
0 → 100644
浏览文件 @
e584eb28
title
:
month date
desc
:
月日
author
:
zentao
version
:
"
1.0"
fields
:
-
field
:
monthday_common
from
:
base.time.monthday.v1.yaml
use
:
common
prefix
:
"
"
postfix
:
"
\t
"
-
field
:
monthday_with_line
from
:
base.time.monthday.v1.yaml
use
:
with_line
prefix
:
"
"
postfix
:
"
\t
"
-
field
:
monthday_chinese
from
:
base.time.monthday.v1.yaml
use
:
chinese
prefix
:
"
"
postfix
:
"
\t
"
-
field
:
date_common
from
:
base.time.date.v1.yaml
use
:
common
prefix
:
"
"
postfix
:
"
\t
"
-
field
:
date_with_line
from
:
base.time.date.v1.yaml
use
:
with_line
prefix
:
"
"
postfix
:
"
\t
"
-
field
:
date_chinese
from
:
base.time.date.v1.yaml
use
:
chinese
prefix
:
"
"
postfix
:
"
\t
"
\ No newline at end of file
src/gen/generator.go
浏览文件 @
e584eb28
...
...
@@ -2,7 +2,6 @@ package gen
import
(
"errors"
"fmt"
"github.com/easysoft/zendata/src/model"
commonUtils
"github.com/easysoft/zendata/src/utils/common"
constant
"github.com/easysoft/zendata/src/utils/const"
...
...
@@ -247,7 +246,14 @@ func GetFieldValStr(field model.DefField, val interface{}) string {
}
case
string
:
str
=
val
.
(
string
)
fmt
.
Sprintf
(
str
)
match
,
_
:=
regexp
.
MatchString
(
"%[0-9]*d"
,
field
.
Format
)
if
match
{
valInt
,
err
:=
strconv
.
Atoi
(
str
)
if
err
==
nil
{
str
,
success
=
stringUtils
.
FormatStr
(
field
.
Format
,
valInt
)
}
}
default
:
}
...
...
yaml/base/time/date.v1.yaml
0 → 100644
浏览文件 @
e584eb28
title
:
日期时间
desc
:
author
:
zentao
version
:
1.0
field
:
date
instances
:
-
instance
:
common
note
:
普通
prefix
:
fields
:
-
field
:
year
range
:
2020
-
field
:
month_day
from
:
base.time.monthday.v1.yaml
use
:
common
prefix
:
"
"
postfix
:
"
\t
"
-
instance
:
with_line
note
:
下划线
prefix
:
fields
:
-
field
:
year
range
:
2020
postfix
:
"
-"
-
field
:
month_day
from
:
base.time.monthday.v1.yaml
use
:
with_line
prefix
:
"
"
postfix
:
"
\t
"
-
instance
:
chinese
note
:
中文
prefix
:
fields
:
-
field
:
year
range
:
2020
postfix
:
"
年"
-
field
:
month_day
from
:
base.time.monthday.v1.yaml
use
:
chinese
prefix
:
"
"
postfix
:
"
\t
"
\ No newline at end of file
yaml/base/time/monthday.v1.yaml
0 → 100644
浏览文件 @
e584eb28
title
:
月日
desc
:
author
:
zentao
version
:
1.0
field
:
monthdate
instances
:
-
instance
:
common
note
:
普通
prefix
:
fields
:
-
field
:
month
range
:
1{31},2{28},3{31},4{30},5{31},6{30},7{31},8{31},9{30},10{31},11{30},12{31}
format
:
"
%02d"
postfix
:
"
"
-
field
:
day
range
:
1-31,1-28,1-31, 1-30,1-31,1-30, 1-31,1-31,1-30, 1-31,1-30,1-31
format
:
"
%02d"
-
instance
:
with_line
note
:
下划线分隔
prefix
:
fields
:
-
field
:
month
range
:
1{31},2{28},3{31},4{30},5{31},6{30},7{31},8{31},9{30},10{31},11{30},12{31}
format
:
"
%02d"
postfix
:
"
-"
-
field
:
day
range
:
1-31,1-28,1-31, 1-30,1-31,1-30, 1-31,1-31,1-30, 1-31,1-30,1-31
format
:
"
%02d"
-
instance
:
chinese
note
:
中文日期
prefix
:
fields
:
-
field
:
month
range
:
1{31},2{28},3{31},4{30},5{31},6{30},7{31},8{31},9{30},10{31},11{30},12{31}
format
:
"
%02d"
postfix
:
"
月"
-
field
:
day
range
:
1-31,1-28,1-31, 1-30,1-31,1-30, 1-31,1-31,1-30, 1-31,1-30,1-31
format
:
"
%02d"
postfix
:
"
日"
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录