Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modeling-cmds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = "MIT"

[dependencies]
anyhow = "1.0.97"
chrono = "0.4.39"
chrono = { version = "0.4.39", features = ["serde"] }
cxx = { version = "1.0", optional = true }
data-encoding = "2.8.0"
enum-iterator = "2.1.0"
Expand Down
5 changes: 4 additions & 1 deletion modeling-cmds/src/datetime.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

/// A wrapper for chrono types, since we need to impl Value for them.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Default)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Default, Deserialize, Serialize, JsonSchema)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need this equivalent here:

#[cfg_attr(feature = "ts-rs", derive(ts_rs::TS))]
    #[cfg_attr(feature = "ts-rs", ts(export_to = "ModelingCmd.ts"))]
    ```

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and i think the chrono flag on ts-rs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pub struct DateTimeLocal {
value: chrono::DateTime<chrono::Local>,
}
Expand Down
4 changes: 0 additions & 4 deletions modeling-cmds/src/format/fbx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ pub mod export {
pub storage: Storage,

/// Timestamp override.
///
/// This is intended for local integration testing only; it is not provided as an option
/// in the JSON schema.
#[serde(skip)]
pub created: Option<DateTimeLocal>,
}

Expand Down
8 changes: 3 additions & 5 deletions modeling-cmds/src/format/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use crate::coord;
use crate::datetime::DateTimeLocal;

/// Import models in STEP format.
pub mod import {
Expand Down Expand Up @@ -38,12 +39,9 @@ pub mod export {
///
/// [KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html
pub coords: coord::System,

/// Timestamp override.
///
/// This is intended for local integration testing only; it is not provided as an option
/// in the JSON schema.
#[serde(skip)]
pub created: Option<chrono::DateTime<chrono::Utc>>,
pub created: Option<DateTimeLocal>,
}

impl Default for Options {
Expand Down
Loading