| 12 | import { serialize_time } from './widget_time'; |
| 13 | |
| 14 | export interface ISerializedDatetime { |
| 15 | /** |
| 16 | * UTC full year |
| 17 | */ |
| 18 | year: number; |
| 19 | |
| 20 | /** |
| 21 | * UTC zero-based month (0 means January, 11 means December) |
| 22 | */ |
| 23 | month: number; |
| 24 | |
| 25 | /** |
| 26 | * UTC day of month |
| 27 | */ |
| 28 | date: number; |
| 29 | |
| 30 | /** |
| 31 | * UTC hour (24H format) |
| 32 | */ |
| 33 | hours: number; |
| 34 | |
| 35 | /** |
| 36 | * UTC minutes |
| 37 | */ |
| 38 | minutes: number; |
| 39 | |
| 40 | /** |
| 41 | * UTC seconds |
| 42 | */ |
| 43 | seconds: number; |
| 44 | |
| 45 | /** |
| 46 | * UTC millisconds |
| 47 | */ |
| 48 | milliseconds: number; |
| 49 | } |
| 50 | |
| 51 | export function serialize_datetime(value: Date): ISerializedDatetime | null { |
| 52 | if (value === null) { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…