我正在尝试在我的MVC应用程序中创建一个bootstrap datepicker
数据选择器正在加载和创建,但控件没有附加任何样式。
我已确保包含datepicker3.css和bootstrap-datepicker.js文件,并且它们的状态代码为200,所以我不认为这些是问题。
控件的HTML
$('.datepickers').datepicker({
format: 'dd/mm/yyyy'
});
的Javascript
mm/dd/yyyy
上的显示效果
值得注意的是,日期选择器也忽略了格式并使用dd/mm/yyyy
代替$sessionId = get_session_id_that_locked_the_item_from_db();
if(session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
// get current session id.
$current_id = session_id();
// renew activity.
echo 'Renewed my activity.';
$_SESSION['active'] = 1;
// Close the current session
session_write_close();
if($current_id === $sessionId) {
// the current user has locked the item.
}
// Check if the var active of this session exists.
elseif(!checkSessionlastActivity($sessionId, $current_id)) {
// Show the inventory item.
showInventoryItem();
// Lock inventory when the item is selected(eg added to basket).
if('I want to lock the item') {
lockInventoryItem($current_id);
}
}
else {
echo 'Item is locked.';
}
function checkSessionlastActivity($id, $current_id) {
// switch session to the one that locked the item.
session_id($id);
session_start();
// get session is active.
$active = ( isset($_SESSION['active'])? $_SESSION['active']: null);
// Close the session.
session_abort();
// restore current session.
session_id($current_id);
session_start();
if($active !== null) {
return true;
}
return false;
}
function lockInventoryItem($current_id) {
put_my_session_id_to_db($current_id);
}
function showInventoryItem() {
echo 'You can select item';
}
谁能看到我哪里出错了?