24 lines
524 B
CoffeeScript
24 lines
524 B
CoffeeScript
context = window
|
|
rest = window.JK.Rest()
|
|
logger = context.JK.logger
|
|
|
|
@YearSelect = React.createClass({
|
|
instruments: []
|
|
componentDidUnmount: () ->
|
|
@instruments = []
|
|
|
|
componentDidMount: () ->
|
|
rest.getInstruments().done (instruments) =>
|
|
@instruments = instruments
|
|
|
|
render: () ->
|
|
options = []
|
|
|
|
now = new Date().getFullYear()
|
|
for yr in [1901..now]
|
|
options.push `<option value={yr}>{yr}</option>`
|
|
|
|
`<select className="YearSelect react-component">
|
|
{options}
|
|
</select>`
|
|
}) |