1

I want to enter the participant's Date of Birth as input when i go to Test tab and click + Create New Participant (JSON file).

But if I use the DateTime datatype as given in github documentation for Hyperledger Composer Modeling Language, the current date and time is auto inserted which I don't want. How can I do it?

PrashantNagawade
  • 426
  • 1
  • 6
  • 24

1 Answers1

3

either you set it to a base epoch (yyyy-mm-dd) as a suggested format eg.

 o DateTime datefield default="1970-01-01" or
 o DateTime datefield default="1900-01-01"

or you just set it to nothing by using optional eg.

 o DateTime datefield optional

then (in data entry) you can supply the right yyyy-mm-dd (DoB) format only, as you wish in Playground 'Test' - it will set the remainder attributes for (T)ime as zeros and supply the right DateTime format.

cheers

Paul O'Mahony
  • 6,740
  • 1
  • 10
  • 15
  • Thanks, that worked! But gives me the unnecessary time also which isn't required in case of DoB. But that's Hyperledger's fault. Anyways, thanks! – PrashantNagawade Apr 05 '18 at 10:14
  • 1
    What I was thinking is, I am going to integrate fabric with Front-end UI to make a web application. So, I can accept the DoB in date format which I can easily do in UI, and then convert it to String and then send it to fabric to store. Is it feasible?? – PrashantNagawade Apr 05 '18 at 10:17