0

I would generate JSON object on JSON-GENERATOR

I would that the date have this format : 2017-12-31

[ '{{repeat(5, 7)}}', { equityPriceList: [ { date:'{{date(new Date(1970, 0, 1), new Date(),[DD-MM-YYYY])}}', identifiant: "4AAM26636", lastDayTrading: "50%", marketCapitalization: "13,44", objectType: "BUSINESS_GROUP", priceClosing: "100", twelveMHigh: "50", twelveMLow: "30" } ], ordering: "1W" } ] 

Actually I get this error

"date": "<ReferenceError: DD is not defined>"

I have also tried datef('YYYY-MM-DD'); and other combinations

1
  • You want to use dd instead of DD Commented Sep 25, 2018 at 15:24

1 Answer 1

6

The third parameter should be a String. And the day should be in lowercase.

Just like this:

[ '{{repeat(5, 7)}}', { equityPriceList: [ { date:'{{date(new Date(1970, 0, 1), new Date(),"dd-MM-YYYY")}}', identifiant: "4AAM26636", lastDayTrading: "50%", marketCapitalization: "13,44", objectType: "BUSINESS_GROUP", priceClosing: "100", twelveMHigh: "50", twelveMLow: "30" } ], ordering: "1W" } ] 
Sign up to request clarification or add additional context in comments.

3 Comments

Also if you are expecting to have the format 2017-12-31, then in the date should be like this YYYY-MM-dd
Yes that was the solution ("YYYY-MM-dd") but I couldn't add a response to my question right after
And how to generate month multiple times, NO repeat???

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.