0
這是沙姆西日期TIEM日期時間選擇器的示例代碼設置scopr值
的問題是我不知道的範圍是如何設定的變量,gdate
的gdate
計算在HTML值與選擇嘗試時間
我想gdate
謝謝你對我的設置模型數據或範圍新列。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ng-jalaali-flat-datepicker demo</title>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800,300,600' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://thg303.github.io/jalaali-datepicker-demo/dist/ng-jalaali-flat-datepicker.min.css">
<style>
* { font-family: 'tahoma'; direction: rtl;}
</style>
</head>
<body ng-app="testApp" ng-strict-di>
<div ng-controller="mainController">
<h1>نمایش دیت پیکر برای تقویم جلالی </h1>
<input type="text" name="date" ng-jalaali-flat-datepicker datepicker-config="datepickerConfig" gregorian-formatted-picked-date="gfdate" gregorian-picked-date="gdate" ng-model="date">
یا
<button ng-jalaali-flat-datepicker ng-model="date2" type="button" name="button">تاریخی انتخاب کنید</button>
<p>مقادیر حاصل از فیلد متنی
<ul ng-show="gdate">
<li> {{ date | json }} </li>
<li> {{ gdate | json }} </li>
<li> {{ gfdate }} </li>
</ul>
</p>
<p>حاصل انتخاب تاریخ با دکمه:
<ul ng-show="date2">
<li>{{ date2 | json }}</li>
</ul>
</p>
</div>
<!-- JS -->
<script src="https://thg303.github.io/jalaali-datepicker-demo/dist/prerequisities.min.js"></script>
<script src="https://thg303.github.io/jalaali-datepicker-demo/dist/ng-jalaali-flat-datepicker.min.js"></script>
<script src="app.js"></script>
<script>(function() {
'use strict';
/**
* Test code for ng-datepicker demo
*/
angular
.module('testApp', ['ngJalaaliFlatDatepicker'])
.controller('mainController', ['$scope', mainController]);
function mainController ($scope) {
$scope.datepickerConfig = {
allowFuture: false,
dateFormat: 'jYYYY/jMM/jDD',
gregorianDateFormat: 'YYYY/DD/MM',
minDate: moment.utc('2008', 'YYYY')
};
\t \t $scope.date ="1395/04/08";
}
})();
</script>
</body>
</html>
當你說「HTML中的計算值」時,你是什麼意思?它是注入到HTML中的服務器端值嗎? –
@JoelCDoyle不,這是用指令計算的值,請運行代碼片段並選擇日期 –