Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15209 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 15209 Rev 15210
Línea 1... Línea 1...
1
import React, { useState } from 'react'
1
import React, { useState } from 'react'
2
import Datetime from 'react-datetime'
2
import Datetime from 'react-datetime'
3
import { useForm } from 'react-hook-form'
3
import { useForm } from 'react-hook-form'
4
import { useDispatch } from 'react-redux'
-
 
5
import { addNotification } from '../../../redux/notification/notification.actions'
-
 
6
import SearchLocationInput from '../../../shared/SearchLocationInput'
4
import SearchLocationInput from '../../../shared/SearchLocationInput'
7
import SubmitModal from './SubmitModal'
5
import SubmitModal from './SubmitModal'
Línea 8... Línea 6...
8
 
6
 
9
const jobTypeOptions = [
7
const jobTypeOptions = [
Línea 13... Línea 11...
13
	{ label: 'Temporal', value: 't' },
11
	{ label: 'Temporal', value: 't' },
14
]
12
]
Línea 15... Línea 13...
15
 
13
 
Línea 16... Línea -...
16
const AddModal = ({ closeModal, dataLink, googleApiKey, jobCategoryOptions, onComplete }) => {
-
 
17
 
14
const AddModal = ({ closeModal, dataLink, googleApiKey, jobCategoryOptions, onComplete }) => {
18
	const dispatch = useDispatch()
15
 
19
	const { register, watch } = useForm()
16
	const { register, watch } = useForm()
20
	const [year, setYear] = useState(new Intl.DateTimeFormat('en-CA').format(new Date()))
17
	const [year, setYear] = useState(new Intl.DateTimeFormat('en').format(new Date()))
Línea 21... Línea 18...
21
	const [value, setValue] = useState('')
18
	const [value, setValue] = useState('')
22
	const [data, setData] = useState({})
19
	const [data, setData] = useState({})
Línea 45... Línea 42...
45
				<select
42
				<select
46
					className='form-control'
43
					className='form-control'
47
					name="employment_type"
44
					name="employment_type"
48
					ref={register({ required: true })}
45
					ref={register({ required: true })}
49
				>
46
				>
50
					{
-
 
51
						jobTypeOptions.map(({ value, label }) => (
47
					{jobTypeOptions.map(({ value, label }) =>
52
							<option key={value} value={value}>{label}</option>
48
						<option key={value} value={value}>{label}</option>
53
						))
-
 
54
					}
49
					)}
55
				</select>
50
				</select>
56
			</div>
51
			</div>
57
			<div className="form-group">
52
			<div className="form-group">
58
				<label>Último día de aplicación</label>
53
				<label>Último día de aplicación</label>
59
				<Datetime
54
				<Datetime
60
					dateFormat="DD-MM-YYYY"
55
					dateFormat="DD-MM-YYYY"
61
					timeFormat={false}
56
					timeFormat={false}
62
					onChange={(e) =>
57
					onChange={(e) =>
63
						setYear(new Intl.DateTimeFormat('en-CA', { year: 'numeric', month: 'numeric', day: 'numeric' }).format(e.toDate()))
58
						setYear(new Intl.DateTimeFormat('en', { year: 'numeric', month: 'numeric', day: 'numeric' }).format(e.toDate()))
64
					}
59
					}
65
					inputProps={{ className: 'form-control' }}
60
					inputProps={{ className: 'form-control' }}
66
					initialValue={Date.parse(year)}
61
					initialValue={Date.parse(year)}
67
					closeOnSelect
62
					closeOnSelect
68
					value={year}
63
					value={year}