mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-16 05:25:34 +00:00
Added setExpirationDate implementation along with tests
This commit is contained in:
@@ -256,10 +256,17 @@ export default class PKPass extends Bundle {
|
||||
* @returns
|
||||
*/
|
||||
|
||||
setExpiration(date: Date | null): this {
|
||||
/**
|
||||
* @TODO implement
|
||||
*/
|
||||
setExpirationDate(date: Date | null): this {
|
||||
if (date === null) {
|
||||
delete this[propsSymbol]["expirationDate"];
|
||||
return this;
|
||||
}
|
||||
|
||||
const parsedDate = processDate("expirationDate", date);
|
||||
|
||||
if (parsedDate) {
|
||||
this[propsSymbol]["expirationDate"] = parsedDate;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user