Skip to content

Adds toMidnight util method#1521

Merged
shubham1g5 merged 1 commit intomasterfrom
helperCalendarMethod
Feb 26, 2026
Merged

Adds toMidnight util method#1521
shubham1g5 merged 1 commit intomasterfrom
helperCalendarMethod

Conversation

@shubham1g5
Copy link
Contributor

@shubham1g5 shubham1g5 commented Feb 26, 2026

util method for dimagi/commcare-android#3572

Summary by CodeRabbit

  • New Features
    • Added enhanced calendar functionality to improve date/time operations and support more efficient date handling throughout the application.

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66c672b and 44f2598.

📒 Files selected for processing (1)
  • src/main/java/org/javarosa/xform/util/CalendarUtils.java

Walkthrough

A new public static utility method toMidnight(Calendar cal) is added to the CalendarUtils class. This method resets a Calendar instance to midnight by clearing the hour, minute, second, and millisecond fields.

Changes

Cohort / File(s) Summary
Calendar Utility Enhancement
src/main/java/org/javarosa/xform/util/CalendarUtils.java
Added toMidnight(Calendar cal) static utility method that resets a Calendar instance to midnight by clearing hour, minute, second, and millisecond fields.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A midnight method, simple and clean,
Resets those calendars to pristine!
No hours, no minutes to muddy the way,
Just brand new midnight to start the day. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Adds toMidnight util method' directly and specifically describes the main change: the addition of a new utility method named toMidnight to CalendarUtils.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch helperCalendarMethod

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@conroy-ricketts conroy-ricketts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like Code Rabbit's poem 😆

@shubham1g5 shubham1g5 merged commit 25fc5ef into master Feb 26, 2026
2 of 3 checks passed
@shubham1g5 shubham1g5 deleted the helperCalendarMethod branch February 26, 2026 20:48
@shubham1g5
Copy link
Contributor Author

I like Code Rabbit's poem 😆

lol, it's a good one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants