git-subtree-dir: frontend git-subtree-mainline:205a3bd14bgit-subtree-split:c070c0315d
23 lines
620 B
JavaScript
23 lines
620 B
JavaScript
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;
|
|
}
|
|
} |