mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 13:46:45 +00:00
fix: test params
This commit is contained in:
parent
4f9696035a
commit
1efedee68c
@ -143,13 +143,23 @@ describe('filter', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const userCreatedAt = user.get('createdAt');
|
const userCreatedAt = user.get('createdAt');
|
||||||
const year = userCreatedAt.getFullYear();
|
|
||||||
const month = userCreatedAt.getMonth() + 1; // 月份从0开始,因此加1
|
function formatDate(date) {
|
||||||
const date = userCreatedAt.getDate();
|
const year = date.getFullYear();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let day = date.getDate();
|
||||||
|
|
||||||
|
// 确保月份和日期始终是两位数
|
||||||
|
month = month < 10 ? '0' + month : month;
|
||||||
|
day = day < 10 ? '0' + day : day;
|
||||||
|
|
||||||
|
return `${year}-${month}-${day}`;
|
||||||
|
}
|
||||||
|
|
||||||
const count = await PostCollection.repository.count({
|
const count = await PostCollection.repository.count({
|
||||||
filter: {
|
filter: {
|
||||||
'user.createdAt': {
|
'user.createdAt': {
|
||||||
$dateOn: `${year}-${month}-${date}`,
|
$dateOn: formatDate(userCreatedAt),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user