ponjika

package module
v0.0.0-...-50d50b1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2018 License: MIT Imports: 2 Imported by: 0

README

Package ponjika

Build Status Project status Go Report Card Coverage Status GoDoc License

Tiny bengali ponjika based on Gregorian date

Installation

Install the package using

$ go get github.com/thedevsaddam/ponjika
Usage

To use the package import it in your *.go code

import "github.com/thedevsaddam/ponjika"
Example
package main

import (
	"fmt"
	"time"

	"github.com/thedevsaddam/ponjika"
)

func main() {
	layout := "2006-01-02 15:04:05"
	t, _ := time.Parse(layout, "2018-04-14 14:18:00")
	p := ponjika.New(t)
	fmt.Println(p)
	fmt.Println(p.Phonetic())
}
// output:
// ১ বৈশাখ ১৪২৫ রোজ শনিবার
// 1 Boisakh 1425 Roj Shonibar
Credit

This package is directly ported from Nuhil Mehdy's bangla-calendar

Special thanks to Ahmed shamim

See all contributors
Read API doc to know about Available options and Methods
License

The ponjika is an open-source software licensed under the MIT License.

Documentation

Overview

Package ponjika provide basic functionalities for working with bengali calendar Algorithm are directly ported from Nuhil Mehdy's [bangla-calendar] https://github.com/nuhil/bangla-calendar

Index

Constants

This section is empty.

Variables

View Source
var BanglaMonthsList = [...]BN{
	{"পৌষ", "Poush"},
	{"মাঘ", "Maagh"},
	{"ফাল্গুন", "Falgun"},
	{"চৈত্র", "Chaitra"},
	{"বৈশাখ", "Boisakh"},
	{"জ্যৈষ্ঠ", "Joistho"},
	{"আষাঢ়", "Ashar"},
	{"শ্রাবণ", "Shraban"},
	{"ভাদ্র", "Vadro"},
	{"আশ্বিন", "Ashin"},
	{"কার্তিক", "Kartik"},
	{"অগ্রহায়ণ", "Agrahan"},
}

BanglaMonthsList contains bengali month names both bengali font and phonetic

View Source
var BanglaSeasonsList = [...]BN{
	{"শীত", "Sheet"},
	{"বসন্ত", "Bosonto"},
	{"গ্রীষ্ম", "Grismo"},
	{"বর্ষা", "Borsha"},
	{"শরৎ", "Sorot"},
	{"হেমন্ত", "Hemonto"}}

BanglaSeasonsList contains bengali seasons

View Source
var WeekDayList = [...]BN{
	{"রবিবার", "Robibar"},
	{"সোমবার", "Sombar"},
	{"মঙ্গলবার", "Mongolbar"},
	{"বুধবার", "Budhbar"},
	{"বৃহস্পতিবার", "Brihospotibar"},
	{"শুক্রবার", "Shukrobar"},
	{"শনিবার", "Shonibar"},
}

WeekDayList contains list of day weeks both bengali font and phonetic

Functions

func EnToBnYear

func EnToBnYear(year, month, date int) int

EnToBnYear calculate bengali year respect to the Gregorian Year, month and date

Types

type BN

type BN struct {
	Bengali, Phonetic string
}

BN describes both bengali font and phonetic meaning

type Ponjika

type Ponjika struct {
	Year, Date, MonthIndex, TotalDays                                 int
	BengaliYear, BengaliMonth, BengaliDate, BengaliSeason, BengaliDay BN
}

Ponjika describes basic information of bengali panjika

func New

func New(t time.Time) Ponjika

New return a new instance of Ponjika

func (Ponjika) Phonetic

func (p Ponjika) Phonetic() string

Phonetic return bengali date string using phonetic

func (Ponjika) String

func (p Ponjika) String() string

String satisfy stringer inteface

Jump to

Keyboard shortcuts

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