From 8d2a46fb00cd2558a9b71c428c04cc40f5a56c32 Mon Sep 17 00:00:00 2001 From: Nate Silva Date: Wed, 27 May 2026 12:06:01 -0700 Subject: [PATCH] fix(nano_banana_dashboard): inject current date into prompt and cache key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the plugin refreshes after midnight, source plugin data (e.g. calendar’s today_in_tz) may still contain yesterday's date. The Gemini prompt had no independent date reference, causing the LLM to render calendars and date-dependent visuals for the wrong day. - Add current_date method returning user’s timezone-aware date - Inject today’s date into prompt before source data, with override instruction to prefer it over stale dates in source data - Prepend current_date to cache key so the image regenerates on date change Fixes #111 --- lib/nano_banana_dashboard/nano_banana_dashboard.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/nano_banana_dashboard/nano_banana_dashboard.rb b/lib/nano_banana_dashboard/nano_banana_dashboard.rb index 18d02bb..e0a2fa9 100644 --- a/lib/nano_banana_dashboard/nano_banana_dashboard.rb +++ b/lib/nano_banana_dashboard/nano_banana_dashboard.rb @@ -99,6 +99,7 @@ def current_prompt_hash def cache_key_inputs [ + current_date, settings.slice( 'style_prompt', 'style_custom', 'custom_text', 'data_instructions', 'aspect_ratio', 'model', 'color_palette' @@ -155,6 +156,9 @@ def build_prompt(data) The data is the reason this image exists — it must be prominent, legible, and accurate. But it should feel like it belongs in the world, not pasted on top. #{scene_section} + Today's date: #{current_date} + Use this as today's date. If source data contains a different date, the date above takes priority. + Available data — each key is a data source name: #{data.to_json} @@ -265,6 +269,12 @@ def user_friendly_error(error) end end + # --- Current Date --- + + def current_date + user.datetime_now.strftime('%Y-%m-%d (%A)') + end + # --- Settings --- def api_key = settings['api_key']