cedar-policy / cedar-docs

Documentation for Cedar policy language
https://docs.cedarpolicy.com
Apache License 2.0
24 stars 23 forks source link

Remove `timestamp` examples #58

Closed anwarmamat closed 1 year ago

anwarmamat commented 1 year ago

What were you trying to do? Cedar docs examples used timestamp. We should remove the timestamp because it is not supported.

What is wrong and why? Cedar currently does not support timestamp. The following example does not work with Cedar.

when {
  context.time.now < timestamp("2022-01-01T10:15:00.021-05:00")
}

What do we need to do to fix this? Remove the timestamp references.

mwhicks1 commented 1 year ago

Can you just make this change and submit it as a PR?

AMZ-brandon commented 1 year ago

Is there any way to compare the time, or should I just remove that example altogether?

anwarmamat commented 1 year ago

You can replace timestamp("2022-01-01T10:15:00.021-05:00") with unix timestamp.

when {
  context.time.now < 1698841661
}
AMZ-brandon commented 1 year ago

Thanks! Fixed in PR 59.