Skip to content

Create perfect date formats quickly and accurately. Seamlessly integrate them into your development workflow.

License

Notifications You must be signed in to change notification settings

BadreddineIbril/Codate

Repository files navigation

Logo

Codate

Welcome to Codate 👋! Codate is a developer-friendly tool that simplifies date formatting across multiple programming languages. Whether you're working with JavaScript, Python, Java, C#, Ruby, PHP, Swift, Kotlin, Go, or Rust, Codate helps you generate the perfect date format code snippet effortlessly.

Try it Now »


Logo

Features

  • Multi-language Support: Generate date format code snippets for JavaScript, Python, Java, C#, Ruby, PHP, Swift, Kotlin, Go, and Rust.
  • Various Date Formats: Choose from a wide range of date formats including YYYY-MM-DD, MM/DD/YYYY, DD/MM/YYYY, and more.
  • Easy to Use: Select your preferred programming language and date format, then copy the generated code snippet.
  • Developer-Friendly: Save time and avoid errors with our intuitive interface designed specifically for developers.

How to Use

  1. Select Language: Choose your preferred programming language.
  2. Select Date Format: Pick a date format that suits your project's needs.
  3. Copy Code Snippet: Copy the generated code snippet and paste it into your project.

Example

  1. Select Language: JavaScript
  2. Select Date Format: YYYY-MM-DD
  3. Copy Code Snippet:
function formatDate(date) {
  const d = new Date(date);
  const year = d.getFullYear();
  const month = String(d.getMonth() + 1).padStart(2, '0');
  const day = String(d.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}

console.log(formatDate(new Date())); 

// Outputs: 2024-05-01

Beta Notice

⚠️ Notice: Codate is currently in beta. Mobile responsiveness is under development. For now, please use the platform on a desktop or tablet.


Get Involved

Got feedback or ideas? We'd love to hear from you! Open an issue or pull request on GitHub.


Contribute

👾 COD-1337: Hey there, fellow coder! Ready to dive into the world of Codate contributions? Let's embark on this adventure together!

Logo

Step 1: Fork and Clone the Repository

  1. Fork the Repo:

    • Hit that Fork button up top to snag your own copy of the repo.
  2. Clone Your Fork:

    • Fire up your terminal and type:

      git clone https://github.com/BadreddineIbril/Codate.git
      cd Codate

Step 2: Create a New Branch

Stay organized with a fresh branch:

git checkout -b COD-<index>

Step 3: Add the New Language

  1. Navigate to the Language Data File:

    • Open core/data/languages/index.ts.
  2. Add the New Language:

    • Pop a new entry into the LANGUAGES array.

    • Don't forget to get the language icons from Devicon for a more visually appealing display.

      {
        id: "lang_id",
        name: "Language Name",
        icon: "URL_to_language_icon",
      }

Step 4: Add Date Format Functions for the New Language

  1. Navigate to the Date Formats File:

    • Open core/data/date-formats/index.ts.
  2. Add Function Implementations:

    • For each date format, find its file under core/data/date-formats/formats/.

    • Now, add the function for the new language. For instance, for DD/MM/YYYY HH:mm:

      export const DDMMYYYY_HHmm: FunctionDefinition[] = [
        {
         language_id: "your_new_language_id",
         function: ` // Your awesome function goes here! `;
        },
        ...
      ];

Step 5: Commit Your Changes

  1. Stage and Commit:

    git add .
    git commit -m "Added magic ✨"
  2. Push Your Branch:

    git push origin COD<index>

Step 6: Create a Pull Request

  1. Open a PR:
    • Head over to the original Codate repo.
    • Click "Compare & pull request" and give us a heads-up on your changes.

License

MIT License. See the LICENSE file for more details.

About

Create perfect date formats quickly and accurately. Seamlessly integrate them into your development workflow.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published