我做了这个功能:
QuotationId SupplierId
Q-1 S-1
Q-2 S-2
我将时间戳作为日期( $config = array(
"endpoint" => array("localhost" => array("host"=>"localhost",
"port"=>8983, "path"=>"/solr", "core"=>"techproducts",)));
try{
$client = new Solarium_Client($config);
}catch (Exception $e){
echo $e->getMessage();
}
if ($client == null) {
echo 'Client null';
} else {
echo 'Client created</br>';
//v($client);
}
// create a ping query
$ping = $client->createPing();
if ($ping == null) {
echo 'ping null';
} else {
echo 'ping created</br>';
//v($ping);
}
// execute the ping query
try{
$result= $client->ping($ping);
echo 'Ping query successful';
echo '<br/><pre>';
//var_dump($result->getData());
}catch(Solarium_Exception $e){
echo $e->getMessage();
}
,即今天的日期),并打印出来:<body data-ng-controller="TestController">
<br/>
<h4> Filters</h4>
<strong>type de contrat:</strong>
<br>
<input type="checkbox" data-ng-model='type1' data-ng-true-value='contractuel' data-ng-false-value='' /> contractuel
<input type="checkbox" data-ng-model='type2' data-ng-true-value='mixte' data-ng-false-value='' /> mixte
<input type="checkbox" data-ng-model='type3' data-ng-true-value='freelance' data-ng-false-value='' /> freelance
<br>
<strong>salary :</strong>
<br>
<input type="checkbox" data-ng-model='salary1' data-ng-true-value='1000' data-ng-false-value='' />
< 1000 <input type="checkbox" data-ng-model='salary2' data-ng-true-value='2000' data-ng-false-value='' /> between 1000 and 2000
<input type="checkbox" data-ng-model='salary3' data-ng-true-value='3000' data-ng-false-value='' /> between 2000 and 3000
<input type="checkbox" data-ng-model='salary4' data-ng-true-value='4000' data-ng-false-value='' /> >3000
<br>
search:<input type=text placeholder="keyword" ng-model="searchText">
<table id="missions" border="5">
<tr>
<th>
<div align="center">mission title</div>
</th>
<th>
<div align="center">mission salary</div>
</th>
<th>
<div align="center">mission domaine name</div>
</th>
<th>
<div align="center">mission Nature</div>
</th>
</tr>
<tr data-ng-repeat="mission in missions | filter:nature | filter:salary | filter:searchText ">
<td height="28">{{mission.title}}</td>
<td>{{mission.salary}}</td>
<td>{{mission.domain.name}}</td>
<td>{{mission.missionNature.nature}}</td>
</tr>
</table>
</body>
。这怎么可能?
这就是我调用函数的方式:
func getDayOfWeek(date: NSDate) -> String? {
let myCalendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)
let myComponents = myCalendar?.components(NSCalendarUnit.CalendarUnitWeekday, fromDate: date)
let weekDay = myComponents?.weekday
println(date)
return weekNumberToWord(weekDay!)
}
其中1439460000
是将所有数字转换为日期名称为字符串的开关。
答案 0 :(得分:3)
您使用了错误的初始化程序:
init(timeIntervalSinceReferenceDate:)
返回一个NSDate对象,该对象相对于2001年1月1日的第一个时刻,格林尼治标准时间,以给定的秒数初始化。
您应该使用init(timeIntervalSince1970 seconds: NSTimeInterval)
从UNIX时间戳(您显然正在使用)初始化日期:
返回一个NSDate对象,该对象设置为1970年1月1日格林威治标准时间第一个瞬间的给定秒数。
var day = getDayOfWeek(NSDate(timeIntervalSince1970: timestamp.doubleValue))!