Skip to content

Instantly share code, notes, and snippets.

@wilcorrea
Last active March 25, 2020 11:41
Show Gist options
  • Save wilcorrea/980fcfc8744426c97ae1e163d2cb0dfb to your computer and use it in GitHub Desktop.
Save wilcorrea/980fcfc8744426c97ae1e163d2cb0dfb to your computer and use it in GitHub Desktop.
resolvers
import { dateFormat } from '@/sgu-glp/src/utils/date';
const applyDateFormat = dateFormat();
const formatDates = (data, keys) => {
fields.forEach(key => {
data[key] = applyDateFormat(data[key])
})
return data
}
const dadosGerais = data => ({
...formatDates(data, [
'dataInclusao',
'dataReinclusao',
'dataTransferenciaUnimed',
'dataInicioCarencia',
'dataExclusao',
'dataExclusaoProgramada',
'dataObito',
'dataSuspensao',
'dataValidadeCartao',
'dataEmissaoCartao'
])
});
export default {
dadosGerais,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment