Json: great site for faking up test data

Great site here. First 2 show the template I wrote for my composer test data. Final one is the author’s show-it-all template.

Here I try to reduce the Json to the bare minimum (I just want the “composer” line). But I can’t get the 2 dates to work inside the function. Doubtless me. It will do for now.

[
 {
 'repeat(3,3)': {
 dateOfBirth: '{{moment(this.date(new Date(1684, 0, 1), new Date(1722, 0, 1))).format("L")}}',
 dateOfDeath: '{{moment(this.date(new Date(1722, 0, 2), new Date(1801, 0, 1))).format("L")}}', 
 composer: function (tags) {
 return tags.surname().toUpperCase() + ', ' + tags.firstName() + 
 ' (' + this.dateOfBirth + ' - ' + this.dateOfDeath + ') ' ;
 }
 }
 }
]
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s