Skip to content

Commit

Permalink
Merge pull request #7160 from robinovitch61/extension_tutorial_fix
Browse files Browse the repository at this point in the history
add missing code from possible copy/pasta error
  • Loading branch information
blink1073 committed Sep 7, 2019
2 parents ba4c074 + 4d01ec5 commit a104919
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/source/developer/extension_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ file.
constructor() {
super();
this.addClass('my-apodWidget'); // new line
this.addClass('my-apodWidget');
// Add an image element to the panel
this.img = document.createElement('img');
Expand Down Expand Up @@ -665,6 +665,17 @@ file.
}
}
/**
* Get a random date string in YYYY-MM-DD format.
*/
randomDate(): string {
const start = new Date(2010, 1, 1);
const end = new Date();
const randomDate = new Date(start.getTime() + Math.random()*(end.getTime() - start.getTime()));
return randomDate.toISOString().slice(0, 10);
}
}
You've written all of the code before. All you've done is restructure it
to use instance variables and move the image request to its own
function.
Expand Down

0 comments on commit a104919

Please sign in to comment.