* Returns time class that exposes different date time method * @example * ``` * const sf = new Series([ * "2020-01-01", * "2020-01-02", * "2020-01-03", * "2020-01-04", * "2020-01-05", * ]); * const sfd = sf.dt.dayOfWeekName(); *
()
| 1966 | * ``` |
| 1967 | */ |
| 1968 | get dt() { |
| 1969 | if (["string", "datetime"].includes(this.dtypes[0])) { |
| 1970 | return new Dt(this) |
| 1971 | } else { |
| 1972 | throw new Error("Cannot call accessor dt on non-string type"); |
| 1973 | } |
| 1974 | } |
| 1975 | |
| 1976 | /** |
| 1977 | * Overrides default toString implementation. This essentially makes `print()` works. |