Skip to main content

Overview

The Schedule Management module allows you to view, edit, and manage employee work schedules across different months and years. This guide covers all essential workflows for working with schedules.

Viewing Schedules

1

Access the Schedule View

Navigate to the schedules section where you’ll see a calendar-style grid displaying all employees and their assigned shifts.
2

Select Month and Year

Use the month and year dropdowns at the top of the page to navigate to the desired time period. The system defaults to the current month and year.
// Month selector automatically updates to current month
var mesActual = new Date().getMonth();
selectMes.selectedIndex = mesActual;
3

Understanding the Grid

  • Each row represents an employee
  • Each column represents a day of the month
  • Cells contain shift codes (e.g., “A”, “B”, “D” for rest days)
  • Colors indicate different shift types based on your configuration

Shift Color Coding

The system automatically applies colors to shifts based on their configuration in Firebase:
  • Background Color: Retrieved from ColorF field in the Turnos table
  • Text Color: Retrieved from ColorT field in the Turnos table
  • Rest Days (D): Counted separately in the rest days counter
  • Special Dates: Holidays appear with red background
The system uses a global cache to optimize color loading. Colors are preloaded once when the page loads, reducing Firebase queries from hundreds to just one.

Editing Schedules

1

Enter Password

To edit schedules, you need to authenticate:
  1. Click on any editable cell
  2. Enter your password when prompted
  3. Your password is validated against the agentes database
2

Modify Schedule Cells

  • Click on any cell to edit it
  • Type the shift code directly into the cell
  • Colors update automatically based on shift configuration
  • Empty cells default to white background
3

Save Changes

Click the “Save” button to commit your changes. The system will:
  • Validate all entries
  • Update Firebase with new values
  • Log changes to the history (Historial node)
  • Refresh the view automatically
// Only meaningful changes are saved to history
// Empty to empty: Save to Firebase, NOT to history
// Empty to content: Save to Firebase AND history
// Content to empty: Save to Firebase, NOT to history
// Content to different content: Save to Firebase AND history
Changes are permanent once saved. Make sure to review your edits before clicking the Save button.

Import/Export Features

Importing from Clipboard

1

Copy Data

Copy tabular data from Excel or another source to your clipboard.
2

Click Import Button

Click the “Import” button to paste clipboard data into the schedule grid.
3

Confirm Import

Review the imported data and click Save to commit the changes.

Exporting Schedules

The system supports multiple export formats:

Excel Export

1

Open Export Modal

Click the “Export” button to open the export options dialog.
2

Select Excel Format

Click “Export to Excel” to download the current schedule as an .xlsx file.The exported file includes:
  • All employee names
  • Complete shift assignments for the month
  • Day of week headers
  • Rest day counters

PNG Export

1

Generate Image

Click “Export to PNG” to create a visual snapshot of the schedule.
2

Download

The system uses html2canvas to convert the schedule table to an image, which downloads automatically.

Calendar Export (ICS)

1

Select Export ICS

Click “Export to ICS” to generate a calendar file for the selected employee.
2

Import to Calendar

Open the downloaded .ics file with your calendar application (Google Calendar, Outlook, etc.)Each calendar entry includes:
  • Event name: Shift code
  • Location: Work location (e.g., “Arus”)
  • Start and end times from shift configuration
  • All-day events for rest days

Text Export

1

Select Employee

Make sure an employee is selected from the schedule view.
2

Click Text Export

Click the “Export to Text” button to copy a formatted text version to your clipboard.
3

Paste and Share

The formatted text includes:
  • Employee name
  • Month and year
  • Each day with day of week, shift code, and time range
Example output:
Turnos de Juan Pérez en Enero:

Lunes 1: (A) 7:00 AM - 3:00 PM
Martes 2: (B) 3:00 PM - 11:00 PM
Miércoles 3: (D) Descanso
...

Automated Features

Week Borders

The system automatically highlights week boundaries:
  • Detects Sundays in the calendar
  • Draws borders at the end of each week
  • Updates when you change months

Holiday Highlighting

1

Automatic Detection

Holidays are configured in the system and automatically highlighted:
var festivos = {
  "Enero": [1, 12],
  "Febrero": [],
  "Marzo": [23],
  // ... etc
};
2

Visual Indicators

  • Holiday dates appear with red background
  • Current day appears with blue background
  • Current day + holiday appears with orange background

Hours Calculation

The system automatically calculates total hours for each employee:
1

Automatic Counting

When schedules load, the system:
  • Reads shift hour values from the Turnos table
  • Multiplies by the number of times each shift appears
  • Displays totals in the summary row
2

Rest Day Counter

A separate counter tracks days marked with “D” (rest days) for each employee.
Hours are calculated using cached shift data to minimize Firebase reads. The cache updates automatically when shift configurations change.

Weekly Summary View

The system includes a special weekly view that groups schedules by week:
1

Access Weekly View

Navigate to the weekly summary section (Table3).
2

Understanding Week Ranges

  • Weeks run from Monday to Sunday
  • The system calculates complete weeks that overlap with the selected month
  • Week headers show date ranges (e.g., “Semana 1 (1-7 Ene)”)
3

Holiday Indicators

Weeks containing holidays are highlighted with a red header background.

Best Practices

Regular Backups

Export schedules regularly to Excel or PNG for backup purposes.

Double-Check Before Saving

Review all changes carefully before clicking Save, as changes are permanent.

Use Import for Bulk Changes

When updating multiple cells, prepare data in Excel and use the Import feature.

Monitor History

The system logs all meaningful changes to the Historial node for auditing.

Troubleshooting

Solution: The system preloads colors when the page loads. Try refreshing the page to reload the color cache.If colors are still incorrect, verify that:
  • The Turnos table has ColorF and ColorT fields
  • Color values are in hex format without the # prefix
Solution: Check that:
  • You entered the correct password
  • You have internet connectivity
  • The Firebase database is accessible
The console will show specific error messages if Firebase operations fail.
Solution: Verify that:
  • Each shift code in the schedule exists in the Turnos table
  • The Cantidad field contains the correct hour value
  • The cache has been refreshed (reload the page)
Solution: Ensure that:
  • Data is copied as tab-delimited text
  • The number of columns matches the schedule grid
  • You confirmed the import dialog

Creating Templates

Learn how to create shift templates

Working with Procedures

Access documented procedures

Build docs developers (and LLMs) love