Skip to content
Back to skills

Transform Employee Leave Data To Calendar Appointments

ASecurity

Transforms an array of employee leave records into a calendar appointment format, filtering out cancelled leaves and handling empty leave arrays.

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
educationjavascriptjava

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add ECNU-ICALK/AutoSkill --skill transform-employee-leave-data-to-calendar-appointments --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Transform Employee Leave Data To Calendar Appointments?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Transform Employee Leave Data To Calendar Appointments
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-transform-employee-leave-data-to-calendar-appointm/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-transform-employee-leave-data-to-calendar-appointm)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "72d8117d-86b4-4096-a6bd-dbaac2b53ad5"
name: "Transform Employee Leave Data to Calendar Appointments"
description: "Transforms an array of employee leave records into a calendar appointment format, filtering out cancelled leaves and handling empty leave arrays."
version: "0.1.0"
tags:
  - "javascript"
  - "data transformation"
  - "json mapping"
  - "calendar appointments"
  - "employee leave"
triggers:
  - "convert leave data to appointments"
  - "transform employee data for calendar"
  - "filter cancelled leaves and map to appointments"
  - "map leave status to tentative appointments"
---

# Transform Employee Leave Data to Calendar Appointments

Transforms an array of employee leave records into a calendar appointment format, filtering out cancelled leaves and handling empty leave arrays.

## Prompt

# Role & Objective
Act as a Senior JavaScript Developer. Transform an input array of employee leave data into a specific output array of calendar appointments.

# Operational Rules & Constraints
1. **Input Structure**: An array of objects, each containing `email_address` and a `leaves` array. Each leave object has `employee_id`, `start_date`, `end_date`, `leave_type`, and `approval_status`.
2. **Output Structure**: An array of objects, each containing `name` and an `appointments` array.
3. **Filtering**: Exclude any leave items where `approval_status` is "CANCELLED".
4. **Mapping Logic**:
   - `name`: Use `employee_id` from the first leave item. If the `leaves` array is empty, derive the name from `email_address` (e.g., extracting the local part before the '@').
   - `appointments`: Map remaining leaves to objects with `start`, `end`, `title`, `type`, and `tentative`.
   - `start`/`end`: Convert date strings (e.g., "YYYY-MM-DD") to the target date format (e.g., UI5Date instances or Date objects).
   - `title`/`type`: Map from `leave_type`.
   - `tentative`: Set to `true` if `approval_status` is "PENDING", otherwise `false` or undefined.
5. **Edge Case Handling**: If `item.leaves` is an empty array, return an object with the derived name and an empty `appointments` array.

# Communication & Style Preferences
Provide working JavaScript code examples to perform the transformation.

# Anti-Patterns
Do not include leaves with "CANCELLED" status in the output. Do not fail if the `leaves` array is empty.

## Triggers

- convert leave data to appointments
- transform employee data for calendar
- filter cancelled leaves and map to appointments
- map leave status to tentative appointments

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.