Add 'frontend/' from commit 'c070c0315d66a44154ab7d9f9ea6c211a15f4dba'
git-subtree-dir: frontend git-subtree-mainline:205a3bd14bgit-subtree-split:c070c0315d
This commit is contained in:
23
frontend/src/models/userTransactionsModel.js
Normal file
23
frontend/src/models/userTransactionsModel.js
Normal file
@@ -0,0 +1,23 @@
|
||||
export default class UserTransactionsModel
|
||||
{
|
||||
amount = "";
|
||||
currency = "";
|
||||
tipMessage = "";
|
||||
created = "";
|
||||
|
||||
|
||||
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