persical

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2017 License: MIT Imports: 0 Imported by: 0

README

persical

This package provides Persian Calendar Calculations for Go (golang). It separated from Roozh to make it go gettable. Roozh contains implementations for converting between Persian dates and Gregorian dates for JavaScript, Java and C# too.

Basically we just use two functions, PersianToGregorian and GregorianToPersian for conversion between calendars, because Go does not provide a way to describe a calendar other than Gregorian calendar, the default expected/assumed one by package time.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GregorianToPersian

func GregorianToPersian(gyear, gmonth, gday int) (pyear, pmonth, pday int)

GregorianToPersian converts a Gregorian date to Persian date

func PersianToGregorian

func PersianToGregorian(pyear, pmonth, pday int) (gyear, gmonth, gday int)

PersianToGregorian converts a Persian date to Gregorian date

Types

type PersianMonth

type PersianMonth int32

PersianMonth represents a Persian month

const (
	Farvardin PersianMonth = 1 + iota
	Ordibehesht
	Khordad
	Tir
	Mordad
	Shahrivar
	Mehr
	Aban
	Azar
	Dey
	Bahman
	Esfand
)

List of Persian months

func (PersianMonth) String

func (m PersianMonth) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL