Git Product home page Git Product logo

rbnkoirala / nepalidate Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 2.0 57 KB

This Frappe application allows you to use Nepali Date on the Frappe Framework

Home Page: https://github.com/rbnkoirala/nepalidate/wiki

License: MIT License

Python 37.31% JavaScript 32.01% CSS 30.68%
bikram-sambat bikram-samvat custom-app frappe frappe-app frappe-framework nepal nepali-calendar nepali-date-converter erpnext

nepalidate's Introduction

License

mit# Nepali Date

This Frappe application allows you to use Nepali Date on the Frappe Framework. Detail Documentation on Wiki

Installation

To install the Nepali Date application, follow these steps:

  1. Navigate to the frappe-bench directory:

    cd frappe-bench
  2. Clone the repository to your local machine:

    bench get-app https://github.com/rbnkoirala/nepalidate.git
  3. Install the application dependencies:

    bench --site sitename install-app nepalidate
  4. Run the Frappe development server: For Development Server

    bench start

    For Production Server

    sudo supervisorctl restart all
  5. Open your web browser and visit http://localhost:8000.

  6. Log in to the Frappe application using your credentials.

  7. To Test the search "Nepali Date Demo" doctype and try.

Usage

Check on Client Side Script Latest Code

frappe.ui.form.on("Nepali Date Demo", {
    refresh(frm) {
        add_nepali_date_picker(frm, "nepali_date");   // if you dont want to add nepali date only
        add_nepali_date_picker(frm, "nepali_date_convert", "english_date_convert");   //  if you want to add nepali date and convert to english date      
        add_nepali_date_picker(frm, "nepali_date_time_convert", "english_datetime_convert");  // convert in time field

        add_nepali_date_picker(frm, "nepali_date_convert_one", "english_date_convert_one"); 
       
        
        
    },
    english_date_convert(frm) {
        convert_ADBS(frm, "english_date_convert", "nepali_date_convert");  
    },
    english_datetime_convert(frm) {
        convert_ADBS(frm, "english_datetime_convert", "nepali_date_time_convert");  
    },    
    english_date_convert_one(frm) {
        convert_ADBS(frm, "english_date_convert_one", "nepali_date_convert_one");  
    },
    english_datetime_convert_one(frm) {
        convert_ADBS(frm, "english_datetime_convert_one", "nepali_date_convert_one");  
    }
});

Roadmap for Future

The following features are planned for future releases:

  1. Calender POPUP on Child Table #child table code

Screenshot

image

License

This application is licensed under the MIT License. See the LICENSE file for more information.

nepalidate's People

Contributors

ajiragroup avatar rbnkoirala avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ajiragroup asoral

nepalidate's Issues

Allow typing date in Nepali date field

Currently, the date value is not registered until we manually click the date in the date picker. In the default date picker (AD), we can do any of the following:

  1. Type in format: 20240102
  2. Type in format: 2024.01.02
  3. Type in format: 2024-01-02
  4. Navigate to correct month and Click on the date manually
    Anything works.

But in Nepali date field, only one option works: navigate to month and click on date.

If we type in the date value, the corresponding AD date is not converted. Can you add this functionality to make date field more interactive?

Feature request: Apply to all date fields.

This current version works by adding a new date data field. Would it be possible to integrate the conversion by replacing the date picker-showing both AD and BS dates together, recording AD date in system while also displaying BS date below or beside the original date field ?

runtime error

image

### Route

Form/Nepali Date Demo/Nepali Date Demo

### Traceback

Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 110, in application
response = frappe.api.handle(request)
File "apps/frappe/frappe/api/init.py", line 49, in handle
data = endpoint(**arguments)
File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
return frappe.handler.handle()
File "apps/frappe/frappe/handler.py", line 49, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/init.py", line 1683, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
return func(*args, **kwargs)
File "apps/frappe/frappe/desk/form/load.py", line 34, in getdoc
doc = frappe.get_doc(doctype, name)
File "apps/frappe/frappe/init.py", line 1266, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 80, in get_doc
controller = get_controller(doctype)
File "apps/frappe/frappe/model/base_document.py", line 69, in get_controller
site_controllers[doctype] = import_controller(doctype)
File "apps/frappe/frappe/model/base_document.py", line 99, in import_controller
raise ImportError(
ImportError: Nepali Date Demo

### Request Data

{
"type": "GET",
"args": {
"doctype": "Nepali Date Demo",
"name": "Nepali Date Demo"
},
"headers": {},
"error_handlers": {},
"url": "/api/method/frappe.desk.form.load.getdoc",
"request_id": null
}

### Response Data

{
"exception": "ImportError: Nepali Date Demo",
"exc_type": "ImportError"
}

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.