(accessor: string)
| 97 | } |
| 98 | |
| 99 | write(accessor: string): string { |
| 100 | const epoch = this.scope.declareByName("epoch", `new Date("1970/01/01 00:00").getTime()`); |
| 101 | return ` |
| 102 | if (${accessor} instanceof Date) { |
| 103 | ${this.builder.writer.writeVarInt64(`Math.floor((${accessor}.getTime() - ${epoch}) / 1000 / (24 * 60 * 60))`)} |
| 104 | } else { |
| 105 | ${this.builder.writer.writeVarInt64(`Math.floor((${accessor} - ${epoch}) / 1000 / (24 * 60 * 60))`)} |
| 106 | } |
| 107 | `; |
| 108 | } |
| 109 | |
| 110 | read(accessor: (expr: string) => string): string { |
| 111 | const epoch = this.scope.declareByName("epoch", `new Date("1970/01/01 00:00").getTime()`); |
nothing calls this directly
no test coverage detected