Skip to content

Add option to select between date formats - #80

Draft
mrako with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-79
Draft

Add option to select between date formats#80
mrako with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-79

Conversation

Copilot AI commented May 26, 2025

Copy link
Copy Markdown

This PR adds the ability to select between different date formats in both the CLI and web interface.

New features:

Date formatting utility:

  • Added a formatDate function to weeknumber.js that supports ISO, US, and EU date formats
  • ISO format: YYYY-MM-DD (default)
  • US format: MM/DD/YYYY
  • EU format: DD/MM/YYYY

CLI enhancements:

  • Added a -f, --format option to specify the date format
  • Default is ISO format
  • Updated output to show both week number and formatted date
  • Added examples to help documentation
# Show current week number with ISO date format
npx @hopefullyworks/week-number

# Show current week number with EU date format
npx @hopefullyworks/week-number -f EU

Web interface improvements:

  • Added a dropdown to select between different date formats
  • Shows both the week number and the formatted date
  • Added support for 'format' URL parameter to set format on page load
  • Updates URL when format is changed

Example URL with custom date and format:

https://week-number.herokuapp.com/?date=2023-06-22&format=EU

Documentation:

  • Updated README.md with details about the new functionality
  • Added usage examples for both CLI and web interface

All tests are passing, including new tests to verify the date formatting functionality.

Fixes #79.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel

vercel Bot commented May 26, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
week-number ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2025 7:34am

Co-authored-by: mrako <203192+mrako@users.noreply.github.com>
Copilot AI changed the title [WIP] Add an option to select between date formats Add option to select between date formats May 26, 2025
Copilot AI requested a review from mrako May 26, 2025 07:34
Copilot finished work on behalf of mrako May 26, 2025 07:35
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.

Add an option to select between date formats

2 participants