Go-JDF is a Go package that provides functions for converting dates between the Jalali (Persian) calendar and the Gregorian calendar. This package is designed to facilitate date handling in applications that require support for the Jalali calendar, commonly used in Iran and Afghanistan.
- Convert Jalali dates to Gregorian dates.
- Convert Gregorian dates to Jalali dates.
- Format dates in both calendars.
- Accurate leap year calculations.
- Support for Persian language date formatting.
To install the Go-JDF package, use the following command:
go get github.com/No-platforms/go-jdf
Here’s a simple example of how to use the Go-JDF package:
package main
import (
"fmt"
"github.com/No-platforms/go-jdf"
)
func main() {
jalaliDate := jdf.JalaliDate{Year: 1402, Month: 9, Day: 25}
gregorianDate, err := jdf.ToGregorian(jalaliDate)
if err != nil {
fmt.Println("Error converting date:", err)
return
}
fmt.Println("Gregorian Date:", gregorianDate)
// Convert back to Jalali
convertedJalali, err := jdf.ToJalali(gregorianDate)
if err != nil {
fmt.Println("Error converting back to Jalali:", err)
return
}
fmt.Println("Converted Back to Jalali:", convertedJalali)
}
Contributions are welcome! If you would like to contribute to Go-JDF, please follow these steps:
- Fork the Repository: Click on the "Fork" button at the top right of this page.
- Clone Your Fork: Clone your forked repository to your local machine using:
git clone https://github.com/No-platforms/go-jdf.git
- Create a Branch: Create a new branch for your feature or bug fix:
git checkout -b feature/my-feature
- Make Your Changes: Implement your changes or add new features.
- Commit Your Changes: Commit your changes with a descriptive message:
git commit -m "Add new feature"
- Push Your Changes: Push your changes back to your forked repository:
git push origin feature/my-feature
- Create a Pull Request: Go to the original repository and create a pull request.
To help new contributors get started, we recommend:
- Reading through the existing codebase and documentation.
- Checking open issues for tasks that need help.
- Joining discussions in pull requests or issues for guidance.
This project is licensed under the GNU Lesser General Public License (LGPL). See the LICENSE file for more details.
For any questions or inquiries regarding the Go-JDF package, please reach out via [[email protected]] or open an issue in the repository.