Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement chrono Datetime in jrsonnet as a type so that it can be used in custom jrsonnet methods as a type and can be returned from jrsonnet method as a type #166

Open
redoC-A2k opened this issue Jun 1, 2024 · 1 comment

Comments

@redoC-A2k
Copy link

redoC-A2k commented Jun 1, 2024

For example suppose I have a method date
/// Returns current date and time in utc
#[builtin]
fn date(
dateTime: Option,
timeStamp: Option,
year: Option,
monthIndex: Option,
day: Option,
hours: Option,
minutes: Option,
seconds: Option,
milliseconds: Option,
)
Now I want to return chrono::Datetime from above method and then in another method suppose ,
#[builtin]
fn format_date
I want to take chrono::Datetime object/struct as argument and return string .

Please could you provide help ?

@CertainLach
Copy link
Owner

I don't quite understand what do you want. Provide Typed implementation for chrono::Datetime, which will automatically convert it to String for jsonnet code, and back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants