Finding Showtimes
There are multiple ways to discover movie showtimes:By Movie
Start from the homepage or movies directory:- Browse movies in the grid layout
- Click a movie to view its detail page
- See all showtimes organized by cinema and date
- Select a date using the interactive date picker
- Choose a time and book directly at the cinema’s website
By Cinema
Start from the cinema directory:- Visit
/cinemasto see all venues - Select a cinema near you or your preferred location
- Browse movies currently playing at that venue
- Pick a date to see that day’s schedule
- Select a showtime to book tickets
Both approaches show the same showtimes data - just organized differently to match how you prefer to search.
Date Selection
The interactive date picker is the core of showtime navigation:How It Works
Visual Design- Horizontal scrollable list of date buttons
- Each button shows: Day (Mon), Date (15), Month (Mar)
- Selected date highlighted in accent color
- Unselected dates in secondary color
- Click any date to instantly switch showtimes
- No page reload - smooth client-side switching
- First date auto-selected when page loads
- Scrollable on mobile with hidden scrollbars
- Shows all dates with available showtimes
- Typically spans current day through next week
- Automatically filtered to future showtimes only
Technical Implementation
Technical Implementation
The date picker is implemented in
ShowtimesWithDatePicker.astro (lines 42-61) with inline JavaScript for interactivity:- Dates are pre-rendered with all showtime data
- JavaScript toggles visibility using
hiddenclass - Button styles update dynamically on click
- Works with Astro’s page transitions via event listener
Showtime Grouping
Showtimes are intelligently organized for easy browsing:On Movie Pages
Showtimes grouped by cinema (showCinema={true}):
- Compare times across different venues
- See locations to find nearest cinema
- Identify special formats (IMAX, 3D) per venue
On Cinema Pages
Showtimes grouped by movie (showMovie={true}):
- See everything playing at one venue
- Discover movies you might not have considered
- Quick overview of venue’s full schedule
The grouping logic is implemented in helper functions within
ShowtimeList.astro and ShowtimesWithDatePicker.astro that reorganize showtime arrays by cinema or movie ID.Screen Format Filtering
Showtimes automatically display screen format information:Format Types
Standard 2D- No indicator shown (assumed default)
- Most common format
- Shown as “(3D)” after the time
- Typically for action and animated films
- Shown as “(IMAX)” after the time
- Available at select venues
- 4DX, ScreenX, etc. shown when available
- Displayed in parentheses after time
Visual Display
Format indicators:- Appear in smaller text (
text-xs) - Positioned right after the showtime
- Help distinguish premium experiences
- No filtering required - all formats shown together
Time Display Format
All showtimes use consistent, readable formatting:Format Specification
- 12-hour clock: 2:30 PM (not 14:30)
- Lowercase am/pm: Following modern conventions
- No leading zeros: 2:30 PM (not 02:30 PM)
- Minutes always shown: 2:00 PM (not 2 PM)
Implementation
Time formatting uses theformatShowtime() utility:
- Consistent display across the site
- Proper timezone handling
- Readable format for users
Booking Integration
Showtimes connect directly to cinema booking systems:When Links Available
If the cinema provides a booking URL (movie_url):
- Time button is a clickable link
- Opens in new tab (
target="_blank") - Includes
rel="noopener noreferrer"for security - Hover effect shows it’s clickable (accent color)
When Links Not Available
If no booking URL:- Time shown as static button
- Same visual styling
- No hover effect
- User needs to visit cinema website separately
Link Implementation
Link Implementation
The conditional rendering is in
ShowtimeList.astro (lines 57-72):Automatic Filtering
Showtimes NG automatically handles several types of filtering:Past Showtimes Removal
Only future showtimes are displayed:- Database queries use current timestamp
- Filter condition:
gte('start_time', now) - Applies to all showtime queries
- Ensures users only see bookable times
The filtering happens at the database level in
src/lib/queries.ts for functions like getShowtimesForMovie() and getShowtimesForCinema(), ensuring efficient data retrieval.Chronological Sorting
All showtimes are ordered by time:- Primary sort: Date (earliest first)
- Secondary sort: Time of day (morning to night)
- Applied via
.order('start_time')in queries - Consistent across all pages
Empty Date Handling
Dates without showtimes aren’t shown:- Date picker only includes dates with available times
- Grouped data structure automatically excludes empty dates
- Prevents clicking on dates with no content
Performance Optimization
Data Pre-loading
All showtime data is:- Fetched at build time for static pages
- Pre-grouped by date in component logic
- Rendered as HTML (no API calls needed)
- Instantly available on page load
Efficient Grouping
The grouping algorithms:- Run once at build time
- Use efficient reduce operations
- Cache results in the rendered HTML
- Switch dates via CSS (no re-computation)
User Experience Features
Visual Feedback
- Hover effects on clickable times
- Active date highlighted in date picker
- Smooth color transitions
- Clear visual hierarchy
Mobile Optimization
- Horizontal scrolling date picker
- Touch-friendly button sizes (px-3 py-2)
- Responsive text sizing
- Hidden scrollbars for clean look
Accessibility
- Semantic HTML structure
- Clear button labels (time + format)
- Proper link attributes for external sites
- Keyboard-navigable date picker
Showtime Data Flow
- Source: Scraped from cinema websites
- Storage: Supabase database with timestamps
- Query: Filtered to future times, joined with cinema/movie data
- Group: Organized by date, then cinema or movie
- Render: Pre-rendered as static HTML at build time
- Display: Interactive switching via client-side JavaScript
- Link: Direct booking URLs when available from source
The entire showtime flow is optimized for performance with static generation and minimal client-side JavaScript, resulting in fast page loads and instant interactions.