Update common_macro.ftl

pull/69/head
RYAN0UP_ 2018-12-13 17:33:25 +08:00 committed by GitHub
parent bd43112a3e
commit 496f0852f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -36,13 +36,13 @@
<#-- 时间格式化 几...前 --> <#-- 时间格式化 几...前 -->
<#macro timeline datetime=.now> <#macro timeline datetime=.now>
<#assign ct = (.now?long-datetime?long)/1000> <#assign ct = (.now?long-datetime?long)/1000>
<#if ct gte 31104000>${(ct/31104000)?int}年前 <#if ct gte 31104000>${(ct/31104000)?int} 年前
<#t><#elseif ct gte 2592000>${(ct/2592000)?int}个月前 <#t><#elseif ct gte 2592000>${(ct/2592000)?int} 个月前
<#t><#elseif ct gte 86400*2>${(ct/86400)?int}天前 <#t><#elseif ct gte 86400*2>${(ct/86400)?int} 天前
<#t><#elseif ct gte 86400>昨天 <#t><#elseif ct gte 86400>昨天
<#t><#elseif ct gte 3600>${(ct/3600)?int}小时前 <#t><#elseif ct gte 3600>${(ct/3600)?int} 小时前
<#t><#elseif ct gte 60>${(ct/60)?int}分钟前 <#t><#elseif ct gte 60>${(ct/60)?int} 分钟前
<#t><#elseif ct gt 0>${ct?int}秒前 <#t><#elseif ct gt 0>${ct?int} 秒前
<#t><#else>刚刚 <#t><#else>刚刚
</#if> </#if>
</#macro> </#macro>