Overview
DateJS (Date Widget) is a simple javascript widget to display today’s Nepali date in your site. If you want to display date in Bikram Sambat (BS) dynamically, then its easy now. This widget will do that job. You can either show date in English language or in Nepali unicode. It can be configuration easily. Different date formats are available. See Settings section for available date formats. It is not necessary to include any javascript library for using this widget.
Features
- Simple and easy to install
- Customizable
- Supports display language; English or Nepali
- Various date formats
- Supports time also
- Time may be in 24hr or 12hr format
- Supports multiple instance in single page
How To
Intalling this widget is very easy. You just need to copy given code and after customizing it, paste it to your web page. If you are using any CMS or blogging service then paste it in Text/Html widget.
Basic Installation
<script src="http://nilambar.com.np/dateapi/widget.js"></script> <script id="mywidget"> DateJS.Widget(); </script>
Advanced Installation
<script src="http://nilambar.com.np/dateapi/widget.js"></script> <script id="mydatewidget"> DateJS.Widget({ dateLanguage : 'np', dateFormat : 6, showPoweredBy : true, widgetId : 'mydatewidget' }); </script>
Example
To see demo, check sidebar of this blog. ЁЯЩВ
Settings
Property | Default | Description |
---|---|---|
dateLanguage | ‘np’ | Language to display date. Either ‘en’ or ‘np’. Example : np : резреп рд╕рд╛рдЙрди реирежремреп, рд╢реБрдХреНрд░рдмрд╛рд░ en : 19 Shrawan 2069, Friday |
dateFormat | 6 | Integer value assigned for various date formats. Example: 1 : резреп режрек реирежремреп 2 : реирежремреп резреп режрек 3 : реирежремреп режрек резреп 4 : резреп рд╕рд╛рдЙрди реирежремреп 5 : реирежремреп рд╕рд╛рдЙрди резреп 6 : резреп рд╕рд╛рдЙрди реирежремреп, рд╢реБрдХреНрд░рдмрд╛рд░ 7 : рд╢реБрдХреНрд░рдмрд╛рд░, резреп рд╕рд╛рдЙрди реирежремреп 8 : реирежремреп рд╕рд╛рдЙрди резреп, рд╢реБрдХреНрд░рдмрд╛рд░ 9 : рд╢реБрдХреНрд░рдмрд╛рд░, реирежремреп рд╕рд╛рдЙрди резреп |
widgetId | ‘mywidget’ | ID of the widget. If you are using single widget in a page then no need to set this option. For multiple widgets, assign different name to each script’s ID and pass that in this parameter. |
dateSeparator | ‘ ‘ (space) | Date separator. Default is space. You may use ‘-‘, ”, ‘/’. |
showTime | true | Option to whether display time or not. Enter false to disable |
militaryTime | false | true will show time in 24 HOUR format. false for 12 HOUR format |
showTimeBeforeDate | false | Show time after date if false. Use true if you want to display time before date. |
multiLine | false | Set to true if you want to display date and time in separate line. |
showPoweredBy | true | Enable of disable the banner display below the date. Setting false will disable it. [ I would appreciate if you enable banner ЁЯШЫ ] |
Thanks to Jonathan Julian for his example_javascript_widget using which I was able to make this widget. And also kudos to codeartsnepal for Nepali-English Date conversion PHP class.
thank you very much
working fine for single widget.. but multiple widget
doesn't support…What is the solution
thanks lot, it helps me
can you provide source code ??
@Dipesh Shrestha Here is the link for source code — https://github.com/ernilambar/dateapi
Hi, can you specify the license under which this plugin is released? Is it creative common and free to use in Commercial products?