Merge pull request #1942 from 2betop/date

日期快捷键支持上月底
This commit is contained in:
吴多益 2021-05-08 20:03:34 +08:00 committed by GitHub
commit 75a0d9f67a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions

View File

@ -255,6 +255,7 @@ order: 13
- `tomorrow`: 明天
- `endofthisweek`: 本周日
- `endofthismonth`:本月底
- `endoflastmonth`:上月底
- `{n}daysago` : n 天前,例如:`1daysago`,下面用法相同
- `{n}dayslater`: n 天后
- `{n}weeksago`: n 周前

View File

@ -91,6 +91,13 @@ const availableShortcuts: {[propName: string]: any} = {
date: (now: moment.Moment) => {
return now.endOf('month');
}
},
endoflastmonth: {
label: 'Date.endOfLastMonth',
date: (now: moment.Moment) => {
return now.add(-1, 'month').endOf('month');
}
}
};

View File

@ -34,6 +34,7 @@ register('en-US', {
'Date.daysago': '{{days}} day(s) ago',
'Date.dayslater': '{{days}} day(s) later',
'Date.endOfMonth': 'last day of the month',
'Date.endOfLastMonth': 'last day of last month',
'Date.endOfWeek': 'Saturday',
'Date.hoursago': '{{hours}} hour(s) ago',
'Date.hourslater': '{{hours}} hour(s) later',

View File

@ -35,6 +35,7 @@ register('zh-CN', {
'Date.dayslater': '{{days}}天后',
'Date.endOfMonth': '本月最后一天',
'Date.endOfWeek': '周日',
'Date.endOfLastMonth': '上月最后一天',
'Date.hoursago': '{{hours}}小时前',
'Date.hourslater': '{{hours}}小时后',
'Date.invalid': '日期无效',