#42 formatting date
This commit is contained in:
@@ -6,7 +6,18 @@ export default class UserTransactionsModel
|
||||
created = "";
|
||||
|
||||
|
||||
createFromApiResult(apiResult){
|
||||
return Object.assign(apiResult, new UserTransactionsModel())
|
||||
static createFromApiResult(apiResult){
|
||||
const userTransactionModel = Object.assign(new UserTransactionsModel(), apiResult)
|
||||
|
||||
const date = new Date(userTransactionModel.created);
|
||||
const options = {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric',
|
||||
timeZone: 'America/Montreal'
|
||||
};
|
||||
userTransactionModel.created = new Intl.DateTimeFormat('fr-CA', options).format(date);
|
||||
|
||||
return userTransactionModel;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user