Control how the summary area displays selection information in range mode. Perfect for showing pricing, night counts, or custom messaging below the calendar grid.
formatSummaryCallback option is only available when using the JavaScript API (new DateRangePicker(...)). It is not exposed as a web component attribute or property.Custom Range Summary
Customize the summary text below the calendar
Live Demo
The summary appears both inside the calendar (below the grid) and is shown above. Try selecting a date range to see the custom format.
Code Examples
Details
What It Does
Customizes the text shown in the calendar summary area (below the calendar grid) in range mode.
Common Patterns
- With duration - "Nov 1 - Nov 7 (7 days)"
- Day count emphasis - Large bold number + "days"
- Nights for hotels - Use
data.nightsinstead ofdata.days
Available Data
data.startDate- Range start (Date object)data.endDate- Range end (Date object)data.days- Total days in rangedata.nights- Total nights (days - 1)data.localeStrings- Localized text (day/days, night/nights)data.isPreview- True when dragging to adjust dates
Important Note
This does not change the input field value. The input field uses date-format-mask for formatting.
Hotel Booking with Multi-Tier Pricing
Dynamic price badges and itemized summary breakdown
Live Demo
Prices vary by day: Budget ($99), Standard ($149), Premium ($199), Deluxe ($249), Luxury ($299). Each date shows its price as a colored badge. Select a range to see the itemized breakdown.
Code Examples
Details
Key Features
- Dynamic price badges - Each date shows its nightly rate as a colored badge
- 5-tier pricing model - Budget, Standard, Premium, Deluxe, Luxury
- Custom badge styling - Color-coded badges (green → blue → purple → orange → red)
- Itemized breakdown - Summary shows per-tier calculations and grand total
- Current month - Auto-displays current month (no scrolling needed)
- Hover tooltips - Badge tooltips show tier name and price
Pricing Tiers
- Budget ($99) - Mon, Tue, Sun
- Standard ($149) - Wed, Thu
- Premium ($199) - Fri
- Deluxe ($249) - Sat
- Luxury ($299) - Special dates (7th, 14th, 21st, 28th)
Callbacks Used
customStylesCallback- Inject CSS for badge color schemesgetDateMetadataCallback- Return badge data for each dateformatSummaryCallback- Build itemized pricing summary
Use Cases
- Hotels/Vacation Rentals - Show variable pricing on calendar
- Event Ticketing - Different prices for different dates
- Dynamic Pricing - Demand-based or seasonal rates
- Multi-tier Services - Visual price comparison