angularjs-input-birthday
Advanced tools
Comparing version 0.0.4 to 1.1.0
@@ -6,3 +6,3 @@ { | ||
], | ||
"version": "0.0.3", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -9,0 +9,0 @@ "keywords": [ |
@@ -10,16 +10,14 @@ ## Install | ||
<input-birthday data-ng-model="birthdate"></input-birthday> | ||
<pre data-ng-bind="birthdate"></pre> | ||
<input-birthday data-ng-model="birthdateEmpty"></input-birthday> | ||
<pre data-ng-bind="birthdateEmpty"></pre> | ||
### Init with a date | ||
<div ng-controller="InitSampleCtrl as $ctrl"> | ||
<input-birthday data-ng-model="$ctrl.birthdate"></input-birthday> | ||
<pre data-ng-bind="$ctrl.birthdate"></pre> | ||
</div> | ||
<input-birthday data-ng-model="birthdate"></input-birthday> | ||
<pre data-ng-bind="birthdate"></pre> | ||
### Init with default today date | ||
<input-birthday data-ng-model="$ctrl.birthdate" init-today="true"></input-birthday> | ||
<pre data-ng-bind="$ctrl.birthdate"></pre> | ||
<input-birthday data-ng-model="birthdateToday" init-today="true"></input-birthday> | ||
<pre data-ng-bind="birthdateToday"></pre> | ||
@@ -26,0 +24,0 @@ ## Usage |
(() => { | ||
'use strict'; | ||
angular.module('app', ['angularjs-input-birthday']) | ||
.controller('InitSampleCtrl', $scope => { | ||
angular.module('app', [ | ||
'pascalprecht.translate', | ||
'angularjs-input-birthday']) | ||
.config(['$translateProvider', $translateProvider => { | ||
$translateProvider.preferredLanguage('fr'); | ||
$translateProvider.translations('fr', { | ||
'birthday-input': { | ||
'year-label': 'Choose year', | ||
'month-label': 'Choose month', | ||
'day-label': 'Choose day', | ||
years: 'Years', | ||
months: 'Months', | ||
days: 'Days' | ||
} | ||
}); | ||
}]) | ||
.controller('MainCtrl', $scope => { | ||
$scope.birthdate = new Date('1990-02-25'); | ||
}); | ||
})(); |
{ | ||
"name": "angularjs-input-birthday", | ||
"version": "0.0.4", | ||
"version": "1.1.0", | ||
"description": "AngularJS Component for birthday selector", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -42,3 +42,3 @@ import './input-birthday.style.scss'; | ||
if (year && month && (day || !this.askDay)) { | ||
const birthdayDate = moment(year + '-' + month + '-' + day, 'YYYY-MM-DD'); | ||
const birthdayDate = moment(`${year}-${month}-${day}`, 'YYYY-MM-DD'); | ||
if (this.returnFormat) { | ||
@@ -45,0 +45,0 @@ this.ngModel = birthdayDate.format(this.returnFormat); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
895
1
0
59038
25