-
Notifications
You must be signed in to change notification settings - Fork 49
Update date formatting in INVENTORY.MR-DN #3589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: console
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughDate formatting strings were updated in the inventory configuration file. Two date display fields now use abbreviated month names (MMM) instead of full month names (MMMM) and adjusted the date format parameter. No logic or control flow changes were introduced. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
health/configs/Data/INVENTORY.MR-DN(2 hunks)
⏰ Context from checks skipped due to timeout of 10000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Analyze (actions)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
health/configs/Data/INVENTORY.MR-DN (1)
973-973: Same date formatting change applied consistently.This change mirrors the update on line 869, applying the same abbreviated month format (MMM) and
'date'parameter. The consistency across both locations is good, though the same syntax concerns regarding the unquoted format pattern apply here as well.
| { | ||
| "key": "STOCK_EXPIRY", | ||
| "value": "{{fn:formatDate(item.additionalFields.fields.expiryDate, dateTime, dd MMMM yyyy)}}" | ||
| "value": "{{fn:formatDate(item.additionalFields.fields.expiryDate, 'date', dd MMM yyyy)}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for formatDate function definition and usage patterns
echo "=== Searching for formatDate in config files ==="
rg -l 'formatDate' --type json . | head -10
echo -e "\n=== Looking for INVENTORY.MR-DN file and similar patterns ==="
find . -name "*.MR-DN" -o -name "*INVENTORY*" | head -20
echo -e "\n=== Checking for formatDate function definitions ==="
rg -n 'formatDate\s*[:(]' --type js --type ts | head -20Repository: egovernments/DIGIT-Frontend
Length of output: 769
🏁 Script executed:
#!/bin/bash
# Search for formatDate usage in config files and get more context
echo "=== Searching for all formatDate usage in config files ==="
rg 'formatDate' health/configs/Data/ -B 1 -A 1 | head -50
echo -e "\n=== Reading INVENTORY.MR-DN around line 869 ==="
sed -n '860,880p' health/configs/Data/INVENTORY.MR-DN
echo -e "\n=== Reading INVENTORY.MR-DN around line 973 ==="
sed -n '965,985p' health/configs/Data/INVENTORY.MR-DN
echo -e "\n=== Searching for formatDate function in entire codebase ==="
rg 'formatDate\s*=' --type js --type ts --type jsx --type tsx -A 3 | head -40Repository: egovernments/DIGIT-Frontend
Length of output: 7719
Quote the format pattern dd MMM yyyy to match the correct syntax used elsewhere in the codebase.
The format pattern in the third parameter should be a string literal. Compare with STOCKREPORTS.MR-DN, which correctly uses 'dd MMM yyyy' (quoted). INVENTORY.MR-DN lines 869 and 973 have the format pattern unquoted, which is inconsistent with established patterns in the configuration files.
Correct syntax:
"value": "{{fn:formatDate(item.additionalFields.fields.expiryDate, 'date', 'dd MMM yyyy')}}"
🤖 Prompt for AI Agents
In health/configs/Data/INVENTORY.MR-DN around lines 869 (and also check line
973), the date format pattern dd MMM yyyy is unquoted; update the third argument
to be a string literal by surrounding the pattern with quotes (i.e., 'dd MMM
yyyy') so the call becomes fn:formatDate(..., 'date', 'dd MMM yyyy'); ensure
both occurrences are fixed to match the quoted pattern used elsewhere.
Choose the appropriate template for your PR:
Feature/Bugfix Request
JIRA ID
Module
Description
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.