index.js 434 B

12345678910111213141516171819
  1. import { SYMBOL_SERVER_DATE } from '../helper/symbol';
  2. export class ServerDate {
  3. constructor({ offset = 0 } = {}) {
  4. this.offset = offset;
  5. }
  6. get _internalType() {
  7. return SYMBOL_SERVER_DATE;
  8. }
  9. parse() {
  10. return {
  11. $tcb_server_date: {
  12. offset: this.offset
  13. }
  14. };
  15. }
  16. }
  17. export function ServerDateConstructor(opt) {
  18. return new ServerDate(opt);
  19. }