Giter VIP home page Giter VIP logo

nepalidateconverter's Introduction

Nepali Date Converter

Nepali Date Converter converts Bikram sambat Nepali date to English date and vice versa. It is a date converter between Bikram sambat B.S and Gregorian calendar (Anno Domini)(A.D). Now Bikram Sambat Nepali Date Converter can convert dates from 2000B.S - 2090B.S. Nepali Date Converter is functioning almost around 2 years, in this time several fixes and updates are made to make results accurate and error free. Adhik maas or Purushottam maas with DST if applicable are determined and pre calculated here so you will get accurate date conversion. Useful for converting nepali date of birth to english, historical nepali dates, filling online application form, etc and vice versa.

Install composer from here.

Install Git bash from here

Create a project by running command on git bash:

composer create-project laravel/laravel DateConverter

Go to the project :

cd DateConverter

Create a Controller :

php artisan make:controller DateController

And now write the code into DateController by cloning as follows

git clone https://github.com/EkloSahas/NepaliDateConverter.git

Create two functions in helpers as

if (!function_exists('get_nepali_date')) {
    function get_nepali_date($date)
    {
        $bsdate = new DateController();
        return $bsdate->eng_to_nep($date);

    }
}

if (!function_exists('get_english_date')) {
    function get_english_date($date)
    {
        $bsdate = new DateController();
        return $bsdate->nep_to_eng($date);

    }
}

Don't forget to import the DateController class in helper

use App\Http\Controllers\DateController;

Now Create another Controller :

php artisan make:controller TestController

And now write the code into TestController as follows

public function convert()
{
$english_date="2019-06-20";
$nepali_date="2052-08-03";

echo get_nepali_date($english_date);// A.D. to B.S.
echo "\n";
echo get_english_date($nepali_date);// B.S. to A.D.
}

Now create a url for the convert function TestController

Route::get('/convert','TestController@convert');

Now run the project and goto url

php artisan serve
#goto url
localhost:8000/convert

Important thing to remember

The date format should be in "Y-m-d"

nepalidateconverter's People

Contributors

sahasdangol avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.