UNPKG

alpha-version-dce-check-in-api

Version:

API for taking attendance and checking people in.

25 lines (19 loc) 571 B
// Import types import OccurrenceBasicInfo from '../types/OccurrenceBasicInfo'; // Import helpers import toStringMMDDYY from './toStringMMDDYY'; /** * Given occurrence info generates the corresponding ID. * @author Benedikt Arnarsson */ const genOccurrenceId = (occurrence: OccurrenceBasicInfo): string => { const { courseId, ihid, // Spread deconstruct will collect month, day, year ...mmddyy } = occurrence; const formattedDate = toStringMMDDYY(mmddyy); return `${courseId}-${ihid}-O${formattedDate}`; }; export default genOccurrenceId;