我的 NestJS API 返回格式为“YYYY-mm-dd”的字符串,我希望它的格式类似于“dd-mm-YYYY”,或者如果可能的话返回日期对象。
NestJS 也无法识别 Angular 何时发送日期。我是否需要以特定方式将其作为字符串发送,或者 Nest 可以转换它?
我正在寻找答案和文档一段时间,但没有找到任何
我的实体是这样的:
export class Example {
@PrimaryGeneratedColumn()
id: number;
@Column('date', { nullable: true })
date: Date;
}
Run Code Online (Sandbox Code Playgroud)
API返回的结果是这样的:
[
{
'id': '1',
'date': '2020-06-25'
}
]
Run Code Online (Sandbox Code Playgroud) 我有这个清单:
[['Nom', 'Francais', 'Anglais', 'Maths'], ['Catherine', '9', '17', '9'], ['Karim', '12', '15', '11'], ['Rachel', '15', '15', '14'], ['Roger', '12', '14', '12'], ['Gabriel', '7', '13', '8'], ['Francois', '14', '8', '15'], ['Henri', '10', '12', '13'], ['Stephane', '18', '12', '8'], ['Karine', '9', '10', '10'], ['Marie', '10', '10', '10'], ['Claire', '15', '9', '12'], ['Marine', '12', '9', '12']]
Run Code Online (Sandbox Code Playgroud)
我想用名称对其进行排序(或者,换句话说,按列表中每个列表的 [0] 元素的字母顺序排序),但我不希望第一个列表 ( )['Nom', 'Francais', 'Anglais', 'Maths']与其他人,怎么能这么做呢?
多谢 !