Home Blog Page 8

Visual Basic (VB) Is Not Dead: Coming Language Features in Visual Basic 14!

Visual Basic (VB) Is Not Dead: Coming Language Features in Visual Basic 14!

Microsoft skips to naming the next version of Visual Basic, and commits to new language developments that are planned for release at the same time as the release of Visual Studio 15.

http://visualstudiomagazine.com/articles/2014/12/16/visual-basic-14-preview.aspx

http://www.classicvb.org/petition/

http://www.classicvb.org/petition/faq.asp

 

 

Open source compilers – NET Compiler Platform (“Roslyn”) provides C# and Visual Basic compilers with rich code analysis APIs.

The .NET Compiler Platform (“Roslyn”) provides open-source C# and Visual Basic compilers with rich code analysis APIs.

The .NET Compiler Platform (“Roslyn”) provides open-source C# and Visual Basic compilers with rich code analysis APIs. It enables building code analysis tools with the same APIs that are used by Visual Studio.

Try new language and IDE features

Just want to provide feedback on new language features and IDE features?

  • Try out Visual Studio 2015 Preview, which has the latest features built-in.Want to keep your box clean? You can use prebuilt Azure VM images with VS 2015 Preview already installed.
  • You can also try April’s End User Preview, which installs on top of Visual Studio 2013. (Note: The VS 2013 preview is quite out of date, and is no longer being updated.)

Build tools that understand C# and Visual Basic

Get started building diagnostics, code fixes, refactorings, and other code-aware tools!

  1. Set up a box with Visual Studio 2015 Preview. Either install Visual Studio 2015 Preview, or grab aprebuilt Azure VM image.
  2. Install the Visual Studio 2015 Preview SDK. You’ll need to do this even if you’re using the Azure VM image.
  3. Install the SDK Templates VSIX package to get the Visual Studio project templates.
  4. Install the Syntax Visualizer VSIX package to get a Syntax Visualizer tool window to help explore the syntax trees you’ll be analyzing.

Or, you can grab the latest NuGet Roslyn compiler package. From the NuGet package manager console:

Install-Package Microsoft.CodeAnalysis -Pre

Source code

Get started

 

 

Reference Source Code available at: https://github.com/dotnet/roslyn

 

Thanks,
SABIT SOLUTIONS

New features in Microsoft Visual Basic 2014

0

New features in Microsoft Visual Basic 2014

“Visual Basic 14” is the version of Visual Basic that will ship with Visual Studio 2015. In this blog post I’ll talk specifically about the VB language improvements in this release. (Separately, there are a whole host of IDE and project-system improvements as well). There are two overall themes to the language improvements:

(1) Make common coding patterns a little cleaner, with easy-to-grasp syntax

(2) Fix up some irritating corners of the language that you probably already expected to work.

This release will be easier to digest than was Visual Basic 12, with its introduction of async! (The version number of Visual Basic has gone straight from 12 to 14, skipping 13. We did this to keep in line with the version numbering of Visual Studio itself.)

I’ll only talk here about the most important new language features. For a full exhaustive list, look at roslyn.codeplex.com > Documentation > Language Features.

(Note: this post has still “before/after” pictures. You can also read a version of this post with animated pictures. I think the animations make the new features come alive!)

 

The ?. operator

The new ?. operator is an easier way to check whether something is null before dotting into it. It’s useful because production-quality code is typically littered with hundreds of null-checks all over the place, and ?. will make them all easier to read. Here’s how you might change your code to use the ?. operator:

One neat trick is to combine it with the null-coalescing (binary) “If” operator, in this case to get a default value:

You can also use ?. to avoid invoking a method off a null reference:

When using ?. to access a field/property that’s a value-type (ie. structure) rather than reference-type (i.e. class), and when invoking a function that returns a value-type, then what you get back is a nullable of that value-type:

Actually, the ?. operator is safer than all the above examples suggest. The expression “customer?.Age” actually reads “customer” into a temporary variable, checks if it’s not null, and then fetches the Age property from that temporary. This is thread-safe even if a different thread happens to null out customer after the check but before reading the property.

You can also use “?.” in a sequence and you can mix with the regular “.” operator, e.g. a?.b.c?.d. It reads left-to-right. Any null value in “?.” will just stop the sequence short, and any null value in “.” will raise a NullReferenceException as usual.

Pro tip: Theoretically the ECMA CLI spec allows a memory model where even the temporary isn’t thread-safe; but in practice in every implementation of .NET the temporary is thread-safe.

Pro tip: When you do ?. to access a field of value-type, you get back a nullable of that value type. But what do you think happens when the compiler doesn’t know whether it’s a value-type or not? For instance in “Sub f(Of T)(x As StrongBox(Of T)) : Dim y = x?.Value : End Sub”.

Pro tip: In addition to ?. there are a few more null-conditional operators: indexing “array?(index)”; delegate invocation “delegate?(args)”; dictionary access “dict?!key”. It also works with XML accessors “x?.<p>” and “x?.@attr” and “x?…<p>”.

The NameOf operator

[Note: NameOf isn’t yet in VS2015 Preview. Watch out for it to arrive before VS2015 finally ships.]

Look at use of the new NameOf operator:

The “before” and “after” behavior is exactly the same: NameOf(customer) simply returns the constant string “customer”, and does this at compile-time. What’s great about using NameOf is that it works with IDE features like Rename and Find All References.

Here’s another place where you’ll likely want to use NameOf:

Pro tip: We decided to make NameOf a new reserved keyword in VB. If you have existing code with methods or variables named “NameOf” then they’ll fail to compile once you upgrade to VS2015, or in some pathological cases you’ll actually get a clean compile but different behavior. You’ll have to escape them as “@NameOf”.

Pro tip: Because NameOf is a constant, you can use it in lots of places – even inside attribute arguments.

Pro tip: You can use qualified expressions like NameOf(customer1.Age). And you can also dot off types like NameOf(Customer.Age).

String Interpolation

[Note: String Interpolation isn’t yet in VS2015 Preview. Watch out for it to arrive before VS2015 finally ships.]

String interpolation is my favourite feature this release. I know that ?. is more powerful, and nameof() will make my code more robust, but every time I type an interpolated string it gives me a little shiver of excitement! Here’s how it looks:

String interpolation is nothing more than a syntactic shorthand for String.Format. As such, it also allows format specifiers:

Pro tip: It will also be possible to use different cultures, and also just to extract the raw format-string and arguments (e.g. if you wanted to use it for SQL queries and needed to escape the arguments to prevent string-injection attacks). But we haven’t yet closed on the design for that.

One question we’ve been pondering is: what color should the braces be? the ones that enclose an expression inside the interpolated string? Here are some options…

What do you think?

Multiline Strings

You used to have to use cumbersome workarounds to get multiline strings in VB. Thankfully VB14 now supports multiline strings literals directly:

One common workaround that people used was to embed their multiline strings into XML literals. Again, this is no longer needed:

Pro tip: VB string literals are now exactly like C# verbatim strings.

Pro tip: Does the multiline string literal use vbCrLf, vbCr, or vbLf for the linebreaks? Answer: it uses whatever line-terminators that your source code file used.

Readonly Auto-properties

We’ve made it considerably easier to write readonly auto-properties. Here’s how you do it:

As you can see, readonly autoprops can be initialized in-line or in the constructor, just like normal properties. It’s not allowed to assign to a readonly autoprop after the constructor has finished.

Comments

Comments are now handled better in statements that split over multiple lines. This is particularly nice for LINQ expressions. Look at these “before” and “after” videos… previously it was simply an error to include these comments:

Other changes

There are host of smaller features also added to Visual Basic 14. Full details are at roslyn.codeplex.com > Documentation >Language Features.

Another exciting change is that the Visual Basic compiler is now open-source, and the language design process too has moved into the open: the VB team at Microsoft are stewards of the language; we discuss the proposals and comments made by the public and we publish our Language Design Meeting notes publicly. A lot of the new features on this page have been improved by the public. If you have time to contribute to Visual Basic 15, we’d love to listen to your thoughts…

  1. Download Visual Studio 2015 Preview to try it out
  2. Visual Studio Uservoice – this is where to raise and vote for your feature requests
  3. Roslyn.codeplex.com > Language Features – this is where to find the current state of language design
  4. Roslyn.codeplex.com > Discussions – this is where to comment in-depth on existing language feature proposals, to contribute with your own use-cases that you’d like helped by new language features, and to submit your own proposals.

 

Thanks,
SABIT SOLUTIONS

Chosen – A Sleek jQuery plug-in for auto-search, auto-suggestions, multi-select within drop down lists for desktop browsers

Chosen – A Sleek jQuery plug-in for auto-search, auto-suggestions, multi-select within drop down lists for desktop browsers #Chosen

Chosen is a jQuery plugin that makes long, unwieldy select boxes much more user-friendly.

One of the best plug-ins available for drop down lists with searching facility.

Chosen is a library for making long, unwieldy select boxes more user friendly.

  • jQuery support: 1.4+
  • Prototype support: 1.7+

For documentation, usage, and examples, see: http://harvesthq.github.io/chosen/

For downloads, see: https://github.com/harvesthq/chosen/releases/

Brower Installation

Chosen does not currently support command-line bower install chosen installation. This is because the repo does not contain the compiled sources, and bower does not currently support adding a post-install/build step.

However, you can specify that you’d like to use the release ZIP, which includes the compiled and minified sources.

Either install from the command line with

$ bower install https://github.com/harvesthq/chosen/releases/download/v1.3.0/chosen_v1.3.0.zip

or add Chosen to your own project’s bower.json file, like:

{
  "name": "my-project",
  "version": "1.0.0",
  "dependencies": {
    "jquery": "1.11.0",
    "chosen": "https://github.com/harvesthq/chosen/releases/download/v1.3.0/chosen_v1.3.0.zip"
  }
}

Source: https://github.com/harvesthq/chosen

DEMO: http://harvesthq.github.io/chosen/

The following options are available to pass into Chosen on instantiation.

Example:

  $(".my_select_box").chosen({
    disable_search_threshold: 10,
    no_results_text: "Oops, nothing found!",
    width: "95%"
  });
Option Default Description
allow_single_deselect false When set to true on a single select, Chosen adds a UI element which selects the first element (if it is blank).
disable_search false When set to true, Chosen will not display the search field (single selects only).
disable_search_threshold 0 Hide the search input on single selects if there are fewer than (n) options.
enable_split_word_search true By default, searching will match on any word within an option tag. Set this option to false if you want to only match on the entire text of an option tag.
inherit_select_classes false When set to true, Chosen will grab any classes on the original select field and add them to Chosen’s container div.
max_selected_options Infinity Limits how many options the user can select. When the limit is reached, the chosen:maxselectedevent is triggered.
no_results_text “No results match” The text to be displayed when no matching results are found. The current search is shown at the end of the text (e.g., No results match “Bad Search”).
placeholder_text_multiple “Select Some Options” The text to be displayed as a placeholder when no options are selected for a multiple select.
placeholder_text_single “Select an Option” The text to be displayed as a placeholder when no options are selected for a single select.
search_contains false By default, Chosen’s search matches starting at the beginning of a word. Setting this option totrue allows matches starting from anywhere within a word. This is especially useful for options that include a lot of special characters or phrases in ()s and []s.
single_backstroke_delete true By default, pressing delete/backspace on multiple selects will remove a selected choice. When false, pressing delete/backspace will highlight the last choice, and a second press deselects it.
width Original select width. The width of the Chosen select box. By default, Chosen attempts to match the width of the select box you are replacing. If your select is hidden when Chosen is instantiated, you must specify a width or the select will show up with a width of 0.
display_disabled_options true By default, Chosen includes disabled options in search results with a special styling. Setting this option to false will hide disabled results and exclude them from searches.
display_selected_options true By default, Chosen includes selected options in search results with a special styling. Setting this option to false will hide selected results and exclude them from searches.

Note: this is for multiple selects only. In single selects, the selected result will always be displayed.

Attributes

Certain attributes placed on the select tag or its options can be used to configure Chosen.

Example:

  <select class="my_select_box" data-placeholder="Select Your Options">
    <option value="1">Option 1</option>
    <option value="2" selected>Option 2</option>
    <option value="3" disabled>Option 3</option>
  </select>
Attribute Description
data-placeholder The text to be displayed as a placeholder when no options are selected for a select. Defaults to “Select an Option” for single selects or “Select Some Options” for multiple selects.

Note:This attribute overrides anything set in the placeholder_text_multiple orplaceholder_text_single options.

multiple The attribute multiple on your select box dictates whether Chosen will render a multiple or single select.
selected, disabled Chosen automatically highlights selected options and disables disabled options.

Classes

Classes placed on the select tag can be used to configure Chosen.

Example:

  <select class="my_select_box chosen-rtl">
    <option value="1">Option 1</option>
    <option value="2">Option 2</option>
    <option value="3">Option 3</option>
  </select>
Classname Description
chosen-rtl Chosen supports right-to-left text in select boxes. Add the class chosen-rtl to your select tag to support right-to-left text options.

Note: The chosen-rtl class will pass through to the Chosen select even when theinherit_select_classes option is set to false.

Triggered Events

Chosen triggers a number of standard and custom events on the original select field.

Example:

  $('.my_select_box').on('change', function(evt, params) {
    do_something(evt, params);
  });
Event Description
change Chosen triggers the standard DOM event whenever a selection is made (it also sends a selected or deselected parameter that tells you which option was changed).

Note: in order to use change in the Prototype version, you have to include the Event.simulate class. The selected and deselected parameters are not available for Prototype.

chosen:ready Triggered after Chosen has been fully instantiated.
chosen:maxselected Triggered if max_selected_options is set and that total is broken.
chosen:showing_dropdown Triggered when Chosen’s dropdown is opened.
chosen:hiding_dropdown Triggered when Chosen’s dropdown is closed.
chosen:no_results Triggered when a search returns no matching results.

Note: all custom Chosen events (those that being with chosen:) also include the chosen object as a parameter.

Triggerable Events

You can trigger several events on the original select field to invoke a behavior in Chosen.

Example:

  // tell Chosen that a select has changed
  $('.my_select_box').trigger('chosen:updated');
Event Description
chosen:updated This event should be triggered whenever Chosen’s underlying select element changes (such as a change in selected options).
chosen:activate This is the equivalant of focusing a standard HTML select field. When activated, Chosen will capure keypress events as if you had clicked the field directly.
chosen:open This event activates Chosen and also displays the search results.
chosen:close This event deactivates Chosen and hides the search results.

Thanks and Peace,
SABIT SOLUTIONS

Simple-dtpicker – Locale supported Date & Time picker – A very good jQuery plugin with lot’s of parameters

Locale supported Date & Time picker – A very good jQuery plugin with lot’s of parameter based functionalists.

One of the best jQuery based Calender for Date/Time input #Simple-dtpicker.js

DEMOS: http://mugifly.github.io/jquery-simple-datetimepicker/jquery.simple-dtpicker.html#

SOURCE and OPTIONS: https://github.com/mugifly/jquery-simple-datetimepicker/wiki/Options

See below for explanation, options of this library.

These options are also able to be used in combination.


locale

You can specify language(locale) on calendar.

This option is reflected in changing the following items:

  • Calendar
    • Header (YYYY-MM)
    • Days of the week (Su, Mo, Tu, We, Th, Fr, Sa)
  • dateFormat default value

Default value

en (english)

Example of use

<div id="date-picker"></div>
<script type="text/javascript">
$(function(){
    $('date-picker').dtpicker({
        "locale": "ja"
    });
});
</script>

Available locales

Specify this option as two of the below characters.

  • “en” : English (default)
  • “ja” : Japanese
  • “ru” : Russian – Thanks to: rdolgushin. (v1.1.3-)
  • “br” : Brazil – Thanks to: Mauricio. (v1.1.4-)
  • “cn” : Chinese – Thanks to: jasonslyvia (v1.3.0-)
  • “de” : German – Thanks to: rtakeda (v1.3.0-)
  • “id” : Bahasa Indonesia – Thanks to: robzlabz (v1.4.0-)
  • “tr” : Turkish – Thanks to: myfell (v1.5.0-)
  • “sv” : Swedish – Thanks to: MacDknife (v1.5.0-)
  • “es” : Spanish – Thanks to: maw (v1.5.0-)

improved in future updates…


current

You can specify default current date.

Default value

The current date and time.

Example of use

<input type="text" id="date">
<script type="text/javascript">
    $(function(){
        $('#date').appendDtpicker({
            'current' : '2012-01-01 00:00'
        });
    });
</script>

[Caution] If an input-field is not empty, THIS OPTION becomes INVALID.


dateFormat

You can specify output format (when using appendDtpicker() method for input-field).

Default value

YYYY-MM-DD hh:mm

(This format varies, if your setting the “locale” option. For example, if “locale” option is “ja”, this format will become “YYYY/MM/DD hh:mm”. )

Example of use

<input type="text" id="date">
<script type="text/javascript">
    $(function(){
        $('#date').appendDtpicker({
            'dateFormat' : 'YYYY/MM/DD hh:mm'
        });
    });
</script>

In that case…Sample output (input-field):

2012/01/01 10:30

Available format (example date: 2012-01-02 06:07)

  • YYYY: Year (Full) – ex: 2012
  • YY: Year (Century) – ex: 12
  • MM: Month – ex: 01
  • M: Month – ex: 1
  • DD: Day – ex: 02
  • D: Day – ex: 2
  • hh: Hour – ex: 06
  • h: Hour – ex: 6
  • mm: Minutes – ex: 07
  • m: Minutes – ex: 7

minuteInterval

You can change the interval of minute on timelist.

Default value

  1. This means the interval will be 30 minutes between each option on the timelist.

Example of use

<input type="text" id="date">
<script type="text/javascript">
    $(function(){
        $('#date').appendDtpicker({
            'minuteInterval' : 15
        });
    });
</script>

Available value

min: 5 … max: 30.


firstDayOfWeek

Set the first day of the week displayed in the calendar

Default value

0

Example of use

<input type="text" id="date">
<script type="text/javascript">
    $(function(){
        $('#date').appendDtpicker({
            'firstDayOfWeek' : 1
        });
    });
</script>

Available value

min: 0 … max: 6.

  • 0 = Sunday
  • 1 = Monday
  • 2 = Tuesday
  • etc.

closeOnSelected

Close (disappear) the picker when the date & time have been selected.

This option is available when the picker has appended to input-field.

Default value

false

A lightweight, customizable javascript timepicker plugin for jQuery inspired by Google Calendar #jQuery-timepicker

A lightweight, customizable javascript timepicker plugin for jQuery inspired by Google Calendar #jQuery-timepicker

Use this plugin to unobtrusively add a timepicker dropdown to your forms. It’s lightweight (2.7kb minified and gzipped) and easy to customize.

Requirements

Usage

$('.some-time-inputs').timepicker(options);

options is an optional javascript object with parameters explained below.

You can also set options as data attributes on the intput elements, like <input type="text" data-time-format="H:i:s" />. Timepicker still needs to be initialized by calling $('#someElement').timepicker();.

The defaults for all options are exposed through the $.fn.timepicker.defaults object. Properties changed in this object (same properties configurable through the constructor) will take effect for every instance created after the change.

Options

  • show2400
    Show “24:00” as an option when using 24-hour time format.
    default: false
  • appendTo
    Override where the dropdown is appended.
    Takes either a string to use as a selector, a function that gets passed the clicked input element as argument or a jquery object to use directly.
    default: “body”
  • className
    A class name to apply to the HTML element that contains the timepicker dropdown.
    default: null
  • closeOnWindowScroll
    Close the timepicker when the window is scrolled. (Replicates <select> behavior.)
    default: false
  • disableTimeRanges
    Disable selection of certain time ranges. Input is an array of time pairs, like `[['3:00am', '4:30am'], ['5:00pm', '8:00pm']]. The start of the interval will be disabled but the end won’t.default: []
  • disableTouchKeyboard
    Disable the onscreen keyboard for touch devices.
    default: false
  • durationTime
    The time against which showDuration will compute relative times. If this is a function, its result will be used.
    default: minTime
  • forceRoundTime
    Force update the time to step settings as soon as it loses focus.
    default: false
  • lang
    Language constants used in the timepicker. Can override the defaults by passing an object with one or more of the following properties: decimal, mins, hr, hrs.
    default: { am: 'am', pm: 'pm', AM: 'AM', PM: 'PM', decimal: '.', mins: 'mins', hr: 'hr', hrs: 'hrs' }
  • maxTime
    The time that should appear last in the dropdown list. Can be used to limit the range of time options.
    default: 24 hours after minTime
  • minTime
    The time that should appear first in the dropdown list.
    default: 12:00am
  • noneOption
    Adds one or more custom options to the top of the dropdown. Can accept several different value types:
    Boolean (true): Adds a “None” option that results in an empty input value
    String: Adds an option with a custom label that results in an empty input value
    Object: Similar to string, but allows customizing the element’s class name and the resulting input value. Can contain label, value, and className properties. value must be a string type.
    Array: An array of strings or objects to add multiple non-time options
    default: false
  • scrollDefault
    If no time value is selected, set the dropdown scroll position to show the time provided, e.g. “09:00”. A time string, Date object, or integer (seconds past midnight) is acceptible, as well as the string 'now'.
    default: null
  • selectOnBlur
    Update the input with the currently highlighted time value when the timepicker loses focus.
    default: false
  • show2400
    Show “24:00” as an option when using 24-hour time format.
    default: false
  • showDuration
    Shows the relative time for each item in the dropdown. minTime or durationTime must be set.
    default: false
  • showOnFocus
    Display a timepicker dropdown when the input gains focus.
    default: true
  • step
    The amount of time, in minutes, between each item in the dropdown.
    default: 30
  • timeFormat
    How times should be displayed in the list and input element. Uses PHP’s date() formatting syntax. Characters can be escaped with a preceeding double slash (e.g. H\\hi). Alternatively, you can specify a function instead of a string, to use completely custom time formatting. In this case, the format function receives a Date object and is expected to return a string. default: ‘g:ia’
  • typeaheadHighlight
    Highlight the nearest corresponding time option as a value is typed into the form input.
    default: true
  • useSelect
    Convert the input to an HTML <SELECT> control. This is ideal for small screen devices, or if you want to prevent the user from entering arbitrary values. This option is not compatible with the following options: appendTo, closeOnWindowScroll, disableTouchKeyboard, forceRoundTime,scrollDefaultNow, selectOnBlur, typeAheadHighlight.
    default: true

Methods

  • getSecondsFromMidnight
    Get the time as an integer, expressed as seconds from 12am.

    $('#getTimeExample').timepicker('getSecondsFromMidnight');
  • getTime
    Get the time using a Javascript Date object, relative to a Date object (default: today).

    $('#getTimeExample').timepicker('getTime'[, new Date()]);

    You can get the time as a string using jQuery’s built-in val() function:

    $('#getTimeExample').val();
  • hide
    Close the timepicker dropdown.

    $('#hideExample').timepicker('hide');
  • option
    Change the settings of an existing timepicker. Calling option on a visible timepicker will cause the picker to be hidden.

    $('#optionExample').timepicker({ 'timeFormat': 'g:ia' }); // initialize the timepicker sometime earlier in your code
    ...
    $('#optionExample').timepicker('option', 'minTime', '2:00am');
    $('#optionExample').timepicker('option', { 'minTime': '4:00am', 'timeFormat': 'H:i' });
  • remove
    Unbind an existing timepicker element.

    $('#removeExample').timepicker('remove');
  • setTime
    Set the time using a Javascript Date object.

    $('#setTimeExample').timepicker('setTime', new Date());
  • show
    Display the timepicker dropdown.

    $('#showExample').timepicker('show');

Events

  • change
    The native onChange event will fire any time the input value is updated, whether by selection from the timepicker list or manual entry into the text input. Your code should bind to change after initializing timepicker, or use event delegation.
  • changeTime
    Called after a valid time value is entered or selected. See timeFormatError and timeRangeErrorfor error events. Fires before change event.
  • hideTimepicker
    Called after the timepicker is closed.
  • selectTime
    Called after a time value is selected from the timepicker list. Fires before change event.
  • showTimepicker
    Called after the timepicker is shown.
  • timeFormatError
    Called if an unparseable time string is manually entered into the timepicker input. Fires beforechange event.
  • timeRangeError
    Called if a maxTime, minTime, or disableTimeRanges is set and an invalid time is manually entered into the timepicker input. Fires before change event.

Theming

Sample markup with class names:

<input value="5:00pm" class="ui-timepicker-input" type="text">
...
<div class="ui-timepicker-wrapper ui-timepicker-positioned-top optional-custom-classname" tabindex="-1">
    <ul class="ui-timepicker-list">
        <li>12:00am</li>
        <li>12:30am</li>
        ...
        <li>4:30pm</li>
        <li class="ui-timepicker-selected">5:00pm</li>
        <li class="ui-timepicker-disabled">5:30pm</li>
        <li>6:00pm <span class="ui-timepicker-duration">(1 hour)</span></li>
        <li>6:30pm</li>
        ...
        <li>11:30pm</li>
    </ul>
</div>

The ui-timepicker-positioned-top class will be applied only when the dropdown is positioned above the input.

Simple Clockface timepicker for Twitter Bootstrap!

Simple Clockface timepicker for Twitter Bootstrap!

http://vitalets.github.io/clockface/

ns

format

String. Default: H:mm

Time format. Possible tokens are: H,h,m,a.
If set H or HH – it’s 24h format, central link works as 0-11 / 12-23 toggle.
If set h or hh – it’s 12h format, central link works as AM / PM toggle.

trigger

String. Default: focus

How to trigger clockface.
Possible values: focus|manual.
If set focus it’s applied only when attached toinput.

Methods

.clockface(options)

Initializes widget.

$('#time').clockface({format: 'HH:mm'});

show

Arguments:

  • time (string|object) [optional]

Shows widget.

$('#time').clockface('show', '12:30');

hide

Hides widget.

$('#time').clockface('hide');

toggle

Arguments:

  • time (string|object) [optional]

Toggles show/hide.

$('#time').clockface('toggle');

setTime

Arguments:

  • time (string|object)

Sets time of widget.

$('#time').clockface('setTime', '2:30');

getTime

Arguments:

  • asObject (boolean). Default: false

Returns time in specified format. If asObject = true returns object containing hour, minuteand ampm values.

var s = $('#time').clockface('getTime');

Events

shown.clockface

Fires when widget was shown.

$('#time').on('shown.clockface', 
function(e, data) {
  alert(data.hour);
});

All events have second parameter data with current hour, minute and ampm values.

hidden.clockface

Fires when widget was hidden.

pick.clockface

Fires every time when user picks hour, minute or am/pm.

Clock-style Time picker for Bootstrap (or jQuery) with better User interface

Clock-style Time picker for Bootstrap (or jQuery) with better User interface

Another clock-style timepicker for Bootstrap (or jQuery) with better UI. Supported on all browsers and devices.

https://github.com/weareoutman/clockpicker

 

 http://weareoutman.github.io/clockpicker/

 

Browser support

All major browsers are supported, including IE 9+. It should look and behave well enough in IE 8.

Device support

Both desktop and mobile device are supported. It also works great in touch screen device.

Dependencies

ClockPicker was designed for Bootstrap in the beginning. So Bootstrap (and jQuery) is the only dependency(s).

Since it only used .popover and some of .btn styles of Bootstrap, I picked these styles to build a jQuery plugin. Feel free to use jquery-* files instead of bootstrap-* , for non-bootstrap project.

Usage

<!-- Bootstrap stylesheet -->
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">

<!-- ClockPicker Stylesheet -->
<link rel="stylesheet" type="text/css" href="dist/bootstrap-clockpicker.min.css">

<!-- Input group, just add class 'clockpicker', and optional data-* -->
<div class="input-group clockpicker" data-placement="right" data-align="top" data-autoclose="true">
    <input type="text" class="form-control" value="09:32">
    <span class="input-group-addon">
        <span class="glyphicon glyphicon-time"></span>
    </span>
</div>

<!-- Or just a input -->
<input id="demo-input" />

<!-- jQuery and Bootstrap scripts -->
<script type="text/javascript" src="assets/js/jquery.min.js"></script>
<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>

<!-- ClockPicker script -->
<script type="text/javascript" src="dist/bootstrap-clockpicker.min.js"></script>

<script type="text/javascript">
$('.clockpicker').clockpicker()
    .find('input').change(function(){
        // TODO: time changed
        console.log(this.value);
    });
$('#demo-input').clockpicker({
    autoclose: true
});

if (something) {
    // Manual operations (after clockpicker is initialized).
    $('#demo-input').clockpicker('show') // Or hide, remove ...
            .clockpicker('toggleView', 'minutes');
}
</script>



Thanks,
SABIT SOLUTIONS

Time Picki – A light weight jQuery Time Picker plugin for using in form submission websites.

Time Picki – A light weight jQuery Time Picker plugin for using in form submission websites.

User can easily pick time in the form with using it. Latest version is 2.0

http://senthilraj.github.io/TimePicki/index.html

Features

Easy to use
Developers can easily implement timepicker in a website using the lightweight timepicki.js and timepicki.css
24H & AM/PM notation
Timepicki allows to use a 24-hour or 12-hour (with AM/PM notation) based clock
Access with keys
Users are able to choose time using the Arrow keys on the keyboard, and can also move from hour to minute field using the Tab key.
Set time limit
Developers are able to set an hour or minute limit for their project. For example time from 1 to 5 o’clock only
Set step size
Developers are able to choose the step size with which hours and minutes are incremented/decremented.
Change arrow direction
Developer can determine which arrow increments or decrements the time
User can type time
In timepicki users can also type hour or minute via keyboard. Allthough it’s possible to disable this for mobile use, to prevent keyboard from showing up.
Clean UI
Timepicki has a simple and clean User interface, so users can easily understand and use it

 

Options

http://senthilraj.github.io/TimePicki/options.html

 

 

 

Thanks and Peace,
SABIT SOLUTIONS

jQuery Calenders – A plugin that provides support for various world calendars (localization)

A jQuery plugin that provides support for various world calendars (localization)

The current version is 2.0.0 and is available under the MIT licence.

http://keith-wood.name/calendars.html

Islamic Calender also available:

Days and Months: 
Yawm al-ahad
Yawm al-ithnayn
Yawm ath-thulaathaa’
Yawm al-arbi’aa’
Yawm al-khamīs
Yawm al-jum’a
Yawm as-sabt

Months:

Muharram
Safar
Rabi’ al-awwal
Rabi’ al-thani
Jumada al-awwal
Jumada al-thani
Rajab
Sha’aban
Ramadan
Shawwal
Dhu al-Qi’dah
Dhu al-Hijjah

 

For more documentation please refer to : http://keith-wood.name/calendarsRef.html

 

——————

$.calendars.instance(name, language) // Retrieve calendar
$.calendars.newDate(year, month, day, calendar, language) // Create a date

calendar.name // The calendar name
calendar.jdEpoch // Julian date of start of epoch
calendar.hasYearZero // True if has a year zero, false if not
calendar.minMonth // The minimum month number
calendar.firstMonth // The first month in the year
calendar.minDay // The minimum day number
calendar.regionalOptions // Localisations
calendar.newDate(year, month, day) // Create a date
calendar.today()
calendar.leapYear(year) // Is a leap year?
calendar.epoch(year) // BCE/CE
calendar.formatYear(year) // Formatted year
calendar.monthsInYear(year)
calendar.monthOfYear(year, month) // To ordinal month
calendar.fromMonthOfYear(year, ord) // From ordinal month
calendar.weekOfYear(year, month, day)
calendar.daysInYear(year)
calendar.dayOfYear(year, month, day)
calendar.daysInMonth(year, month)
calendar.daysInWeek()
calendar.dayOfWeek(year, month, day) // 0 = Sunday, …
calendar.weekDay(year, month, day) // Is a week day?
calendar.extraInfo(year, month, day)
calendar.add(date, offset, period) // Update a period
calendar.set(date, value, period) // Set a period
calendar.isValid(year, month, day)
calendar.toJD(year, month, day) // To Julian Date
calendar.fromJD(jd) // From Julian Date
calendar.toJSDate(year, month, day) // To JavaScript Date
calendar.fromJSDate(jsd) // From JavaScript Date

 

 

Thanks and Peace,
SABIT SOLUTIONS