jam-cloud/web/app/assets/javascripts/react-components/YearSelect.js.jsx.coffee

24 lines
554 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" required placeholder="Select">
{options}
</select>`
})