JQUERY datepicker calendar, how can I rename the “today” button to “present” - jquery-ui-datepicker

I want to change "Today" button text in Jquery datepicker to "Present".
and also customise the functionality
Any thoughts please

Answer from the comment. It may be helpful to some people
currentText: "Present"
code example:
$('.date-picker').datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true,
currentText: 'present',
closeText : 'Close',
dateFormat: 'MM yy',
});

Related

How can I display both values as labels when hovering over chart.js

I have tried to make the labels for both datasets in the chart.js found here.
example of chart.js to appear when hovering over the different days in the chart
I have tried to add this...
options: {
tooltips: {
mode: 'index',
intersect: false
},
hover: {
mode: 'index',
intersect: false
}
}
Bu that does not help, in a perfect world I would like to display it like 28 (30) when hovering over SUNDAY. Can somebody help out please?
Since you dont use the build in tooltip to display those values setting tooltip modes dont matter.
To get what you want just put the values in the same span the way you like so you would get this:
<div class="tick">
SUN
<span class="value value--this">28 (30)</span>
</div>
https://codepen.io/leelenaleee/pen/OJjOamw

How do I create a component that generates Radio-buttons in Ember.js?

Can I and should i pass arrays to components in ember?
For example if I wanted to template something that renders a couple of radiobuttons with labels:
<label for="media">Media</label><input type="radio" name="entry.1602323871" value="media" id="media" />
<label for="guest">Guest</label><input type="radio" name="entry.1602323871" value="guest" id="guest" />
Could I somehow pass an array with this content and loop through it.
Media, media
Guest, guest
Yeah, You can pass anything to components. Just a try to the radio-buttons
//Basic radio Component
App.RadioButton = Ember.Component.extend({
tagName : "input",
type : "radio",
attributeBindings : [ "name", "type", "value", "checked:checked" ],
click : function() {
this.set("selection", this.$().val());
},
checked : function() {
return this.get("value") === this.get("selection");
}.property('selection')
});
Em.Handlebars.helper('radio-button',App.RadioButton);
Updated (component name should be dasherized)
Working Radio Demo
It's now a tiny bit easier to get radio-buttons into your project (if you're using ember-cli) by using the ember-radio-buttons addon
Install:
npm install ember-radio-buttons --save-dev
Usage:
{{radio-button value='one' checked=selectedNumber}}
{{radio-button value='two' checked=selectedNumber}}
Upped #selva-G's answer.
I found that using the ButtonGroup Component from Bootstrap-for-Ember is actually cleaner.
Here's what I've done:
In my view's template:
<script type="text/x-handlebars" data-template-name="myview">
{{bs-btn-group contentBinding="things" selectedBinding="selectedThing"}}
</script>
In that view's controller (which doesn't necessarily need to be an ArrayController, rather can be a generic Ember Controller):
App.MyviewController = Ember.ArrayController.extend({
things: [
Ember.Object.create({value: 'first', title: 'First Thing'}),
Ember.Object.create({value: 'second', title: 'Second Thing'}),
Ember.Object.create({value: 'third', title: 'Third Thing'})
],
selectedThing: 'second'
selection: function() {
console.log(this.get('selectedThing');
}.observes('selectedThing')
});

JQuery datepicker does not respond to click event of after clearing the textbox

I have tried rahul's code. It looks like this
$("input:text.inputTypeDate").datepicker({
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true
});
});
ASP
<asp:TextBox ID="txtDt" runat="server" Width="120px" class="inputTypeDate">
</asp:TextBox>
It works fine on page load, but when I clear the textbox, it stops working.

Setting the year range for jQuery datepicker

I am using jQuery datepicker, and I want to set the year range. This is my code:
$( "#birthday" ).datepicker({
changeMonth: true,
changeYear: true,
yearRange: "-100:-10"
});
It loads and becomes unresponsive until both year and month drop down items are selected. What am I doing wrong in above code?

EmberJs: wrapping Bootstrap components (timepicker)

I'm already using the ember-bootstrap plugin (great job !!)
But I need to add a time picker (https://github.com/jdewit/bootstrap-timepicker) to this Bootstrap plugin.
I'm not an EmberJs expert yet...
Can someone provide me some help to wrap this time picker with ember-bootstrap ?
Update:
I have found this solution without ember-bootstrap plugin and it works.
Is it the right way to process ?
Bootstrap.TimePicker = Em.ContainerView.create({
classNames: 'input-append bootstrap-timepicker-component',
childViews: ['inputView', 'iconView'],
inputView: Em.TextField.create({
type: 'text',
valueBinding: 'App.PassController.storeCard.relevantDate',
classNames: 'timepicker-default input-small'
}),
iconView: Em.View.create({
tagName: 'span',
classNames: 'add-on',
template: Ember.Handlebars.compile('<i class="icon-time"></i>')
}),
didInsertElement: function() {
$('.timepicker-default').timepicker({showSeconds: true, defaultTime: 'value'});
}
}).append();