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

implementation of missing SDK functions for LocalDate #1062

Merged
merged 7 commits into from
Mar 12, 2024
31 changes: 31 additions & 0 deletions src/Morphir/IR/SDK/LocalDate.elm
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,35 @@ nativeFunctions =
, ( "toISOString"
, Native.eval1 LocalDate.toISOString Native.decodeLocalDate (Native.encodeLiteral Literal.StringLiteral)
)
, ( "fromParts"
, Native.eval3 LocalDate.fromParts
(Native.decodeLiteral Native.intLiteral)
(Native.decodeLiteral Native.intLiteral)
(Native.decodeLiteral Native.intLiteral)
(Native.encodeMaybe Native.encodeLocalDate)
)
, ( "diffInDays"
, Native.eval2 LocalDate.diffInDays Native.decodeLocalDate Native.decodeLocalDate (Native.encodeLiteral Literal.intLiteral)
)
, ( "diffInWeeks"
, Native.eval2 LocalDate.diffInWeeks Native.decodeLocalDate Native.decodeLocalDate (Native.encodeLiteral Literal.intLiteral)
)
, ( "diffInMonths"
, Native.eval2 LocalDate.diffInMonths Native.decodeLocalDate Native.decodeLocalDate (Native.encodeLiteral Literal.intLiteral)
)
, ( "diffInYears"
, Native.eval2 LocalDate.diffInYears Native.decodeLocalDate Native.decodeLocalDate (Native.encodeLiteral Literal.intLiteral)
)
, ( "addDays"
, Native.eval2 LocalDate.addDays (Native.decodeLiteral Native.intLiteral) Native.decodeLocalDate Native.encodeLocalDate
)
, ( "addWeeks"
, Native.eval2 LocalDate.addWeeks (Native.decodeLiteral Native.intLiteral) Native.decodeLocalDate Native.encodeLocalDate
)
, ( "addMonths"
, Native.eval2 LocalDate.addMonths (Native.decodeLiteral Native.intLiteral) Native.decodeLocalDate Native.encodeLocalDate
)
, ( "addYears"
, Native.eval2 LocalDate.addYears (Native.decodeLiteral Native.intLiteral) Native.decodeLocalDate Native.encodeLocalDate
)
]