ummalqura

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2026 License: MIT Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

nbrain-umm-alqura-go

Zero-dependency Go 1.22+ SDK for Saudi Umm al-Qura / Hijri Calendar Conversion (Arabic & English month names, fiscal quarters) and MENA Banking Settlement Days (T+1 / T+2) across Saudi Tadawul/SAMA, Egypt EGX/CBE, and UAE DFM/ADX/CBUAE.

go get github.com/NBrain-Studio/nbrain-umm-alqura-go@v1.0.0

Built by Eng. Nadeem Mohamed Badr El-Din (nadeembadr.com) & NBrain (nbra.in).

Documentation

Overview

Package ummalqura provides zero-dependency Go 1.22+ Saudi Umm al-Qura / Kuwaiti Hijri calendar conversion and MENA banking settlement business-day calculation for Saudi Tadawul/SAMA, Egypt EGX/CBE, and UAE DFM/ADX/CBUAE systems.

Built by Eng. Nadeem Mohamed Badr El-Din (https://nadeembadr.com/about/) & NBrain (https://nbra.in/). ORCID: https://orcid.org/0009-0005-5836-2631

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSettlementDays

func AddSettlementDays(start time.Time, businessDays int, market Market, holidays map[string]bool) time.Time

AddSettlementDays adds n banking business days (e.g., T+1 or T+2) skipping market weekends and optional holidays (YYYY-MM-DD).

func GregorianToJDN

func GregorianToJDN(year, month, day int) int

GregorianToJDN converts a proleptic Gregorian date to Julian Day Number.

func HijriToGregorian

func HijriToGregorian(hYear, hMonth, hDay int) (time.Time, error)

HijriToGregorian converts a Hijri (year, month, day) date to a UTC Gregorian time.Time.

func IsBusinessDay

func IsBusinessDay(t time.Time, market Market) bool

IsBusinessDay checks whether t is a banking/settlement business day in the specified MENA market.

func JDNToGregorian

func JDNToGregorian(jdn int) time.Time

JDNToGregorian converts a Julian Day Number to a UTC Gregorian time.Time.

Types

type HijriDate

type HijriDate struct {
	Year        int    `json:"year"`
	Month       int    `json:"month"`
	Day         int    `json:"day"`
	MonthNameEn string `json:"month_name_en"`
	MonthNameAr string `json:"month_name_ar"`
	Quarter     int    `json:"fiscal_quarter"`
}

HijriDate represents an Islamic Hijri date with Arabic and English metadata.

func GregorianToHijri

func GregorianToHijri(year, month, day int) HijriDate

GregorianToHijri converts a Gregorian date to a calibrated tabular Hijri date (Kuwaiti / Umm al-Qura epoch).

func (HijriDate) FormatISO

func (h HijriDate) FormatISO() string

FormatISO returns YYYY-MM-DD formatting for the Hijri date.

type Market

type Market string

Market identifies a MENA financial market weekend schedule.

const (
	MarketSaudi Market = "SA" // Sun-Thu business week (Tadawul / SAMA / Qiwa / ZATCA)
	MarketEgypt Market = "EG" // Sun-Thu business week (EGX / CBE / ETA)
	MarketUAE   Market = "AE" // Mon-Fri business week (DFM / ADX / CBUAE)
)

Jump to

Keyboard shortcuts

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