Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (17 sloc) 401 Bytes
import {Converter} from "../decorators/converter";
import {IConverter} from "../interfaces/index";
/**
* Converter component for the `Date` Type.
* @private
* @converters
* @component
*/
@Converter(Date)
export class DateConverter implements IConverter {
deserialize(data: string): Date {
return new Date(data);
}
serialize(object: Date): any {
return object.toISOString();
}
}
You can’t perform that action at this time.