accordproject / template-archive

Smart Legal Contracts & Templating System
https://accordproject.org/projects/cicero/
Apache License 2.0
280 stars 119 forks source link

Cicero-CLI: utcOffset and currentTime concurrent usage gives error #740

Closed K-Kumar-01 closed 2 years ago

K-Kumar-01 commented 2 years ago

Bug Report 🐛

When using the command cicero parse --template <template> --sample <sample> --utcOffset 2 --currentTime "08:06:00", instead of succesfully executing the command, we get an error.

Expected Behavior

The command should run without any errors.

Current Behavior

ERROR: Cannot set current time to '08:06:00' with UTC offset '2' is received currently.

Possible Solution

Steps to Reproduce

  1. Install cicero-cli
  2. Run the command mentioned above

Screenshots

Screenshot from 2022-05-22 08-06-04

Context (Environment)

Desktop

Ayman161803 commented 2 years ago

The problem is with DateTimeUtil module of concerto-core package here. The string currentTime here is expected to be in standard UTC format. We can either modify the expected format to a more convenient regex such as DD-MM-YYYY HH:MM:SS or retain the standard utc format as is. Can I have this issue assigned to me in case it is decided to shift to a more convenient date-time format?

mttrbrts commented 2 years ago

We should enforce use of a UTC format value, however the error message can be improved to guide the user.

K-Kumar-01 commented 2 years ago

We should enforce use of a UTC format value, however the error message can be improved to guide the user.

Should we ask users the format in which they want to enter the date :thinking: ? There are different formats which can provide fleixibility. By default, this can be kept to utc

mttrbrts commented 2 years ago

Should we ask users the format in which they want to enter the date 🤔 ?

IMO, I say no. We should provide a well-defined format that works for everyone. There's a risk that increased flexibility means increased complexity in this case.

Ayman161803 commented 2 years ago

This Issue can be closed after accordproject/concerto#430 @mttrbrts

mttrbrts commented 2 years ago

This Issue can be closed after accordproject/concerto#430 @mttrbrts

Thank you, closing!