Commit 5431242f by Jansa Jose

Date of birth

parent a506adfe
...@@ -137,7 +137,7 @@ if($this->session->userdata('language') == 'en'){ ...@@ -137,7 +137,7 @@ if($this->session->userdata('language') == 'en'){
<?php <?php
$now = date('Y'); $now = date('Y');
$max_year = $now - 18; $max_year = $now - 18;
$min_year = $max_year - 100; $min_year = $max_year - 120;
for($i = $min_year; $i <= $max_year ; $i++){?> for($i = $min_year; $i <= $max_year ; $i++){?>
<option value="<?php echo $i;?>"><?php echo $i;?></option> <option value="<?php echo $i;?>"><?php echo $i;?></option>
<?php } <?php }
......
...@@ -2725,12 +2725,22 @@ $('#reg_choose_pat').click(function(){ ...@@ -2725,12 +2725,22 @@ $('#reg_choose_pat').click(function(){
/* REGISTRATION DATEPICKER JS */ /* REGISTRATION DATEPICKER JS */
/*----------------------------*/ /*----------------------------*/
var date = (new Date()).getFullYear();
console.log(date);
var cur_date = date - 18;
console.log(cur_date);
var max_date = cur_date - 120;
console.log(max_date);
$('#registration-container input').datepicker({ $('#registration-container input').datepicker({
autoclose: true, autoclose: true,
onSelect: function(dateText) { onSelect: function(dateText) {
//console.log("Selected date: " + dateText + "; input's current value: " + this.value); //console.log("Selected date: " + dateText + "; input's current value: " + this.value);
}, },
endDate:"0d", /*endDate:"0d",
startDate:"-120y"*/
/*minDate: '-120Y',
maxDate: '-18Y',*/
endDate:"-18y",
startDate:"-120y" startDate:"-120y"
}) })
...@@ -2739,7 +2749,11 @@ $('#doc-registration-container input').datepicker({ ...@@ -2739,7 +2749,11 @@ $('#doc-registration-container input').datepicker({
onSelect: function(dateText) { onSelect: function(dateText) {
//console.log("Selected date: " + dateText + "; input's current value: " + this.value); //console.log("Selected date: " + dateText + "; input's current value: " + this.value);
}, },
endDate:"0d", /*endDate:"0d",
startDate:"-120y"*/
/*minDate: '-120Y',
maxDate: '-18Y',*/
endDate:"-18y",
startDate:"-120y" startDate:"-120y"
}) })
/* PATIENT EDIT DATEPICKER JS */ /* PATIENT EDIT DATEPICKER JS */
...@@ -2749,7 +2763,9 @@ $('#edit-patient input').datepicker({ ...@@ -2749,7 +2763,9 @@ $('#edit-patient input').datepicker({
onSelect: function(dateText) { onSelect: function(dateText) {
//console.log("Selected date: " + dateText + "; input's current value: " + this.value); //console.log("Selected date: " + dateText + "; input's current value: " + this.value);
}, },
endDate:"0d", /* endDate:"0d",
startDate:"-120y"*/
endDate:"-18y",
startDate:"-120y" startDate:"-120y"
}) })
/*----------------------------*/ /*----------------------------*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment