| 4378 |
4378 |
|
pub unit: Option<&'a str>,
|
| 4379 |
4379 |
|
/// Whether the field lives behind a "more options" disclosure.
|
| 4380 |
4380 |
|
pub extended: bool,
|
|
4381 |
+ |
/// Whether this local wall-clock value is submitted as an absolute instant.
|
|
4382 |
+ |
///
|
|
4383 |
+ |
/// [`FieldKind::DateTime`] asks for a time the way a person says one --
|
|
4384 |
+ |
/// "the 14th at half past two" -- and that names a different moment in
|
|
4385 |
+ |
/// Denver than it does in Berlin. A route that stores an instant needs the
|
|
4386 |
+ |
/// moment, so somebody has to convert. This member says the description
|
|
4387 |
+ |
/// wants that conversion; it does not say how.
|
|
4388 |
+ |
///
|
|
4389 |
+ |
/// # The conversion belongs to the renderer
|
|
4390 |
+ |
///
|
|
4391 |
+ |
/// Because the renderer is the only party that knows what "your computer's
|
|
4392 |
+ |
/// time zone" means for its host. A browser has one and the user is sitting
|
|
4393 |
+ |
/// in it; a TUI reads the host clock; an egui app reads the same clock a
|
|
4394 |
+ |
/// different way. Nothing above the renderer can answer it, and the
|
|
4395 |
+ |
/// alternatives all try: a hidden IANA-zone field needs a host capability
|
|
4396 |
+ |
/// for reading the zone that three hosts answer differently, plus a kind
|
|
4397 |
+ |
/// that does not exist, plus a wire-contract change; a timezone on the
|
|
4398 |
+ |
/// user's profile is a product decision wearing a bug's clothes. Say it
|
|
4399 |
+ |
/// here, and the next reader does not propose them again.
|
|
4400 |
+ |
///
|
|
4401 |
+ |
/// # What a renderer does
|
|
4402 |
+ |
///
|
|
4403 |
+ |
/// Draws the same control it always did -- the flag changes what is
|
|
4404 |
+ |
/// *submitted*, not what is shown -- and converts the local value to an
|
|
4405 |
+ |
/// absolute instant on the way out. A renderer that cannot convert submits
|
|
4406 |
+ |
/// the local value unchanged, which is what every renderer did before this
|
|
4407 |
+ |
/// existed.
|
|
4408 |
+ |
///
|
|
4409 |
+ |
/// No wire contract moves when a site adopts it: the route was already
|
|
4410 |
+ |
/// receiving an instant. What changes is who computed it.
|
|
4411 |
+ |
///
|
|
4412 |
+ |
/// # Which kinds read it
|
|
4413 |
+ |
///
|
|
4414 |
+ |
/// [`FieldKind::DateTime`]'s. `Date` and `Time` are each half a moment and
|
|
4415 |
+ |
/// cannot name one on their own, so the flag is sayable and ignored there,
|
|
4416 |
+ |
/// the way [`options`](Self::options) is on a kind that offers none.
|
|
4417 |
+ |
///
|
|
4418 |
+ |
/// Added 0.37.0, retiring the MNW server's `data-config="publish-at-iso"`
|
|
4419 |
+ |
/// -- the last site of a private per-app vocabulary that this crate exists
|
|
4420 |
+ |
/// to replace.
|
|
4421 |
+ |
pub as_instant: bool,
|
| 4381 |
4422 |
|
}
|
| 4382 |
4423 |
|
|
| 4383 |
4424 |
|
impl<'a> Field<'a> {
|
| 4404 |
4445 |
|
curve: Curve::Linear { step: None },
|
| 4405 |
4446 |
|
unit: None,
|
| 4406 |
4447 |
|
extended: false,
|
|
4448 |
+ |
as_instant: false,
|
| 4407 |
4449 |
|
}
|
| 4408 |
4450 |
|
}
|
| 4409 |
4451 |
|
|