| 264 | } |
| 265 | |
| 266 | init(scaleOpts, opts = {}) { |
| 267 | const time = scaleOpts.time || (scaleOpts.time = {}); |
| 268 | /** @type {DateAdapter} */ |
| 269 | const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date); |
| 270 | |
| 271 | adapter.init(opts); |
| 272 | |
| 273 | // Backward compatibility: before introducing adapter, `displayFormats` was |
| 274 | // supposed to contain *all* unit/string pairs but this can't be resolved |
| 275 | // when loading the scale (adapters are loaded afterward), so let's populate |
| 276 | // missing formats on update |
| 277 | mergeIf(time.displayFormats, adapter.formats()); |
| 278 | |
| 279 | this._parseOpts = { |
| 280 | parser: time.parser, |
| 281 | round: time.round, |
| 282 | isoWeekday: time.isoWeekday |
| 283 | }; |
| 284 | |
| 285 | super.init(scaleOpts); |
| 286 | |
| 287 | this._normalized = opts.normalized; |
| 288 | } |
| 289 | |
| 290 | /** |
| 291 | * @param {*} raw |