作者 朱兆平

update:

1. 增加舱单统计接口和前端静态文件.
2. 更新预配原始相关类文件,以配合统计.
3. 增加预配批量删除处理.
4. 增加批量删除日志接口.
5. 优化swagger-ui配置及访问安全.
6. 增加yml文件swagger-ui配置信息.
7. 更改yml文件对于thymeleaf的XML模式的限制取消,增强对前端html模版和报文xml模版的适应性.

Signed-off-by: mrz <17966059@qq.com>
正在显示 44 个修改的文件 包含 2661 行增加42 行删除

要显示太多修改。

为保证性能只显示 44 of 44+ 个文件。

... ... @@ -14,9 +14,9 @@ spring:
thymeleaf:
cache: false
encoding: UTF-8
mode: XML
suffix: .xml
prefix: classpath:/templates/
# mode: XML
# suffix: .xml
# prefix: classpath:/templates/
resources:
static-locations: classpath:/META-INF/resources/,classpath:/static,classpath:/resources/,file:${web.upload-path}
... ... @@ -37,12 +37,12 @@ spring:
#eureka主机名,会在控制页面中显示
#DEV环境关闭注册。
features:
enabled: false
enabled: true
discovery:
enabled: false
enabled: true
service-registry:
auto-registration:
enabled: false
enabled: true
datasource:
type: com.alibaba.druid.pool.DruidDataSource
... ... @@ -116,11 +116,17 @@ trace: false
debug: true
swagger:
enabled: false
production: false
basic:
enable: true
username: jack
password: Admin2021@999
username: jackMa
password: Admin2024@999
springfox:
documentation:
enabled: false
logging:
file:
... ...
... ... @@ -23,8 +23,8 @@ public class SwaggerConfig {
.apiInfo(apiInfo())
.pathMapping("/")
.select() // 选择哪些路径和api会生成document
.apis(RequestHandlerSelectors.any())// 对所有api进行监控
// .apis(RequestHandlerSelectors.basePackage("com.hanstrovsky.controller"))// 选择监控的package
// .apis(RequestHandlerSelectors.any())// 对所有api进行监控
.apis(RequestHandlerSelectors.basePackage("com.tianbo.analysis.controller"))// 选择监控的package
// .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))// 只监控有ApiOperation注解的接口
//不显示错误的接口地址
.paths(Predicates.not(PathSelectors.regex("/error.*")))//错误路径不监控
... ...
package com.tianbo.analysis.controller;
import com.tianbo.analysis.dao.BusinessAlterLogDao;
import com.tianbo.analysis.model.BusinessAlterLog;
import com.tianbo.analysis.model.ResultJson;
import com.tianbo.analysis.service.BusinessAlterLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.UUID;
@Slf4j
@RestController
@RequestMapping("/businessAlterLog/")
public class BusinessAlterLogController {
@Autowired
BusinessAlterLogService businessAlterLogService;
@PostMapping("add")
public ResultJson add(@RequestBody BusinessAlterLog businessAlterLog){
businessAlterLog.setAutoid(UUID.randomUUID().toString());
businessAlterLog.setCreatedate(new Date());
int i = businessAlterLogService.insert(businessAlterLog);
return i>0 ? new ResultJson("200","变更原因存储成功",businessAlterLog): new ResultJson("400","变更原因存储失败",businessAlterLog);
}
@PostMapping("get")
public ResultJson search(@RequestBody BusinessAlterLog businessAlterLog){
BusinessAlterLog result = businessAlterLogService.selectByBillAutoidAndType(businessAlterLog);
return new ResultJson("200","获取批量删除申报信息成功", result);
}
}
... ...
... ... @@ -3,6 +3,7 @@ package com.tianbo.analysis.controller;
import com.github.pagehelper.PageInfo;
import com.tianbo.analysis.dao.PREPAREMASTERMapper;
import com.tianbo.analysis.model.BatchSend;
import com.tianbo.analysis.model.PREPAREMASTER;
import com.tianbo.analysis.model.ResultJson;
import com.tianbo.analysis.service.PREPARMASTERService;
... ... @@ -10,12 +11,11 @@ import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@Slf4j
@RestController
... ... @@ -51,5 +51,32 @@ public class PREPAREMASTERController {
return new ResultJson("200","OK",pageInfo);
}
@PostMapping("batchDel")
public ResultJson batchDel(@RequestBody BatchSend batchSend,@CookieValue("username") String username,@CookieValue("userid") String userid){
if (StringUtils.isEmpty(batchSend.businessAlterLog.getAlterReason())){
return new ResultJson("400","未提交删除申请原因");
}
if (StringUtils.isEmpty(batchSend.businessAlterLog.getContantname())){
return new ResultJson("400","未提交删除申请联系人或电话");
}
if (StringUtils.isEmpty(batchSend.businessAlterLog.getContenttel())){
return new ResultJson("400","未提交删除申请电话");
}
if (batchSend.billListDes==null || batchSend.billListDes.isEmpty()){
return new ResultJson("400","未选择运单");
}
boolean b = preparmasterService.batchDel(batchSend, username);
if (b){
return new ResultJson("200","批量删除申请发送成功");
}else {
return new ResultJson("400","批量删除申请发送失败");
}
}
}
... ...
package com.tianbo.analysis.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* Created by XYH on 2019/7/9.
*/
@Controller
@RequestMapping("/transmission")
public class TransmissionController {
@RequestMapping("list")
public String show(){return "transmission/transmission.html";}
}
... ...
package com.tianbo.analysis.controller;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import com.tianbo.analysis.model.PREPAREMASTER;
import com.tianbo.analysis.service.TransmissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by XYH on 2019/7/9.
*/
@Controller
@RequestMapping("/transmission")
public class TransmissionJsonController {
@Autowired
TransmissionService service;
@RequestMapping("search.json")
@ResponseBody
public Map<String,Object> selectList(HttpServletRequest request)throws Exception{
String startdate=request.getParameter("startdate");
String enddate=request.getParameter("enddate");
/*Gson gson=new Gson();
String successGson=null;*/
//ModelAndView modelAndView=new ModelAndView();
Map<String,Object> map=new HashMap<String,Object>();
if(startdate!=null&&enddate!=null){
List<ORIGINMANIFESTMASTER> originmanifestmasterList=service.selectOrig(startdate,enddate);
List<PREPAREMASTER> preparemasterList=service.selectPre(startdate,enddate);
/*System.out.print(originmanifestmasterList);
modelAndView.addObject("origlist",originmanifestmasterList);
modelAndView.addObject("prelist",preparemasterList);
modelAndView.setViewName("transmission/transmission");*/
System.out.print(originmanifestmasterList);
map.put("origlist",originmanifestmasterList);
map.put("prelist",preparemasterList);
//successGson=gson.toJson(map);
}
/*return modelAndView;*/
return map;
}
}
... ...
package com.tianbo.analysis.dao;
import com.tianbo.analysis.model.BusinessAlterLog;
public interface BusinessAlterLogDao {
int insert(BusinessAlterLog record);
int update(BusinessAlterLog record);
int insertSelective(BusinessAlterLog record);
int updateSelective(BusinessAlterLog record);
BusinessAlterLog selectByBillAutoidAndType(BusinessAlterLog record);
}
... ...
... ... @@ -37,4 +37,6 @@ public interface ORIGINMANIFESTMASTERMapper {
int updateByPrimaryKeySelective(ORIGINMANIFESTMASTER record);
List<ORIGINMANIFESTMASTER> selectOrig(String start,String end);
}
... ...
... ... @@ -27,6 +27,8 @@ public interface PREPAREMASTERMapper {
int updateByPrimaryKey(PREPAREMASTER record);
int updateDelStatusByPrimaryKey(List<PREPAREMASTER> record);
int updatePreArrivedBill(PREPAREMASTER record);
List<PREPAREMASTER> searchTree(@Param("waybillnomaster") String var1,
... ... @@ -36,4 +38,6 @@ public interface PREPAREMASTERMapper {
);
List<PREPAREMASTER> searchSec(String autoid);
List<PREPAREMASTER> selectPre(String start,String end);
}
... ...
... ... @@ -13,6 +13,8 @@ public interface PREPARESECONDARYMapper {
PREPARESECONDARY selectByPrimaryKey(String autoid);
List<PREPARESECONDARY> selectByPrimaryKeys(List ids);
/**
* 根据主单ID查分单
* @param masterid
... ... @@ -22,5 +24,7 @@ public interface PREPARESECONDARYMapper {
int updateByPrimaryKeySelective(PREPARESECONDARY record);
int updateDelStatusByPrimaryKey(List<PREPARESECONDARY> record);
int updateByPrimaryKey(PREPARESECONDARY record);
}
... ...
... ... @@ -13,4 +13,6 @@ public interface SENDLOGMapper {
int insert(SENDLOG record);
int insertSelective(SENDLOG record);
int batchInsert(List<SENDLOG> record);
}
... ...
package com.tianbo.analysis.model;
import java.util.List;
public class BatchSend {
public BusinessAlterLog businessAlterLog;
public List<String> billListDes;
}
... ...
package com.tianbo.analysis.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* BUSINESS_ALTER_LOG
* @author
*/
@ApiModel(value="com.tianbo.analysis.model.BusinessAlterLog")
@Data
public class BusinessAlterLog implements Serializable {
private static final long serialVersionUID = 1L;
private String autoid;
private Date createdate;
//业务类型
private String businesstype;
//原因
private String alterReason;
//联系人姓名
private String contantname;
//联系人电话
private String contenttel;
//关联运单ID
private String billAuotid;
}
... ...
... ... @@ -4,4 +4,7 @@ import lombok.Data;
public class ManifestBase {
public String messagetype;
// 统计用
public String num;
public String flight;
}
... ...
... ... @@ -3,7 +3,7 @@ package com.tianbo.analysis.model;
import java.util.Date;
import java.util.List;
public class PREPAREMASTER {
public class PREPAREMASTER extends ManifestBase{
private String autoid;
private String flightno;
... ... @@ -84,8 +84,6 @@ public class PREPAREMASTER {
private String arrivedAhead;
public String messagetype;
public List<PREPAREMASTER> chidren;
public String getAutoid() {
... ...
package com.tianbo.analysis.service;
import com.tianbo.analysis.model.BusinessAlterLog;
public interface BusinessAlterLogService {
/**
* 插入一条新的业务变更日志记录。
* @param record 要插入的记录
* @return 插入操作影响的行数
*/
int insert(BusinessAlterLog record);
/**
* 更新一条业务变更日志记录。
* @param record 包含更新信息的记录
* @return 更新操作影响的行数
*/
int update(BusinessAlterLog record);
/**
* 选择性地插入一条新的业务变更日志记录。
* @param record 要插入的记录
* @return 插入操作影响的行数
*/
int insertSelective(BusinessAlterLog record);
/**
* 选择性地更新一条业务变更日志记录。
* @param record 包含更新信息的记录
* @return 更新操作影响的行数
*/
int updateSelective(BusinessAlterLog record);
/**
* 根据账单自动ID和业务类型查询业务变更日志。
* @param record 查询条件
* @return 符合条件的业务变更日志
*/
BusinessAlterLog selectByBillAutoidAndType(BusinessAlterLog record);
}
... ...
package com.tianbo.analysis.service;
import com.github.pagehelper.PageInfo;
import com.tianbo.analysis.model.BatchSend;
import com.tianbo.analysis.model.PREPAREMASTER;
import org.springframework.web.bind.annotation.CookieValue;
public interface PREPARMASTERService {
PageInfo<PREPAREMASTER> search(PREPAREMASTER preparemaster,int pageNum, int pageSize);
... ... @@ -20,4 +22,6 @@ public interface PREPARMASTERService {
String flightNo,
int page,
int limit);
boolean batchDel(BatchSend batchSend,String username);
}
... ...
package com.tianbo.analysis.service;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import com.tianbo.analysis.model.PREPAREMASTER;
import java.util.List;
/**
* Created by XYH on 2019/7/9.
*/
public interface TransmissionService {
List<ORIGINMANIFESTMASTER> selectOrig(String start,String end)throws Exception;
List<PREPAREMASTER> selectPre(String start,String end)throws Exception;
}
... ...
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.BusinessAlterLogDao;
import com.tianbo.analysis.model.BusinessAlterLog;
import com.tianbo.analysis.service.BusinessAlterLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class BusinessAlterLogServiceImpl implements BusinessAlterLogService {
@Autowired
private BusinessAlterLogDao businessAlterLogDao;
@Override
public int insert(BusinessAlterLog record) {
int i = 0;
BusinessAlterLog businessAlterLog = selectByBillAutoidAndType(record);
if (businessAlterLog!=null) {
record.setAutoid(businessAlterLog.getAutoid());
i = businessAlterLogDao.updateSelective(record);
}else {
i = businessAlterLogDao.insert(record);
}
return i;
}
@Override
public int update(BusinessAlterLog record) {
return businessAlterLogDao.update(record);
}
@Override
public int insertSelective(BusinessAlterLog record) {
return businessAlterLogDao.insertSelective(record);
}
@Override
public int updateSelective(BusinessAlterLog record) {
return businessAlterLogDao.updateSelective(record);
}
@Override
public BusinessAlterLog selectByBillAutoidAndType(BusinessAlterLog record) {
return businessAlterLogDao.selectByBillAutoidAndType(record);
}
}
... ...
... ... @@ -7,6 +7,7 @@ import com.tianbo.analysis.dao.MANIFEST_AIR_CHANGEMapper;
import com.tianbo.analysis.dao.SENDLOGMapper;
import com.tianbo.analysis.model.*;
import com.tianbo.analysis.service.MT8204Service;
import com.tianbo.analysis.tools.XSDValidateWithXML;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
... ... @@ -161,9 +162,9 @@ public class MT8204ServiceImp implements MT8204Service {
/**
* 中文的地方在模板中要用utext,否则中文会被 escape 转义
*/
String xmlStr = templateEngine.process("mt8204/MT8204",context);
String xmlStr = templateEngine.process("mt8204/MT8204.xml",context);
boolean valied = validateXMLSchema("xsd/Manifest_Change_Transport_Air_8204_2.xsd",xmlStr);
boolean valied = XSDValidateWithXML.validateXMLSchema("xsd/Manifest_Change_Transport_Air_8204_2.xsd",xmlStr);
if (valied){
FileUtils.writeStringToFile(file,xmlStr, StandardCharsets.UTF_8);
SENDLOG sendlog = new SENDLOG();
... ... @@ -212,23 +213,5 @@ public class MT8204ServiceImp implements MT8204Service {
}
public boolean validateXMLSchema(String xsdPath, String xmlStr) throws IOException {
ByteArrayInputStream bais = new ByteArrayInputStream(xmlStr.getBytes("UTF-8"));
try {
SchemaFactory factory =
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = factory.newSchema(new File(xsdPath));
Validator validator = schema.newValidator();
Source source = new StreamSource(bais);
validator.validate(source);
} catch (IOException | SAXException e) {
e.printStackTrace();
log.error("Exception:{}",e.getMessage());
return false;
}finally {
bais.close();
}
return true;
}
}
... ...
... ... @@ -4,21 +4,53 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.tianbo.analysis.dao.PREPAREMASTERMapper;
import com.tianbo.analysis.model.MANIFEST_AIR_CHANGE;
import com.tianbo.analysis.model.PREPAREMASTER;
import com.tianbo.analysis.dao.PREPARESECONDARYMapper;
import com.tianbo.analysis.dao.SENDLOGMapper;
import com.tianbo.analysis.model.*;
import com.tianbo.analysis.service.PREPARMASTERService;
import com.tianbo.analysis.tools.XSDValidateWithXML;
import com.tianbo.util.Date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.util.ResourceUtils;
import org.springframework.util.StringUtils;
import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.Context;
import javax.annotation.Resource;
import java.util.List;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*;
@Service
@Slf4j
public class PREPARMASTERServiceImpl implements PREPARMASTERService {
@Resource
PREPAREMASTERMapper preparemasterMapper;
@Resource
PREPARESECONDARYMapper preparesecondaryMapper;
@Resource
SENDLOGMapper sendlogMapper;
@Autowired
private TemplateEngine templateEngine;
@Value("${customs.xml-path}")
private String saveXmlDir;
@Value("${customs.transport-number}")
private String transportNo;
@Override
public PageInfo<PREPAREMASTER> search(PREPAREMASTER preparemaster,int pageNum, int pageSize) {
Page<PREPAREMASTER> page = PageHelper.startPage(pageNum,pageSize);
... ... @@ -36,4 +68,151 @@ public class PREPARMASTERServiceImpl implements PREPARMASTERService {
PageInfo<PREPAREMASTER> result = new PageInfo<PREPAREMASTER>(list);
return result;
}
@Override
public boolean batchDel(BatchSend batchSend, String username) {
CustomsHead customsHead = new CustomsHead();
String nowStr = DateUtil.getCurrentTime17();
String messageID = "CN_"
+ "MT2201"
+ "_1P0_"
+ transportNo+
"_" + nowStr;
customsHead.setMessageId(messageID);
customsHead.setSendTime(nowStr);
//航班信息存储
HashMap<String, String> flightMap = new HashMap<>();
ArrayList<Map> bills = new ArrayList<>();
/**
* noList: master;fc68f797-58f9-4276-850d-f772ab54e041;Y87489;2018/7/16 0:00:00;871-52149624;NO;4620
* noList: sub;e430bacf-d34d-49c4-a646-c6bab53245d9;Y87489;2018/7/16 0:00:00;871-52149624;5758599033;4620
* noList: sub;4ff7853f-0315-4632-ad0f-6a028054513d;Y87489;2018/7/16 0:00:00;871-52149624;5758599022;4620
* noList: sub;52dc1407-d686-42ac-87cd-ddacdb84ca18;Y87489;2018/7/16 0:00:00;871-52149624;5758599044;4620
* noList: sub;26bf643c-cf5b-4af2-8394-51585c02d88d;Y87489;2018/7/16 0:00:00;871-52149624;5758599077;4620
*/
if (batchSend.billListDes!=null && !batchSend.billListDes.isEmpty() && batchSend.businessAlterLog!=null){
for (String item : batchSend.billListDes) {
HashMap<String, String> billsMap = new HashMap<>();
String[] split = item.split(";");
//单证类别:master为主单,sub为分单
String billType = split[0];
String billAutoId = split[1];
//航班号
String flightNo = split[2];
//航班日期
String flightDateString = split[3];
// 主单号
String billMasterNo = split[4].replace("-","");
// 分单号
String billSecNo = split[5];
// 申报关区
String customCode = split[6];
flightMap.put("flightNo",flightNo);
flightMap.put("flightDate",flightDateString);
//设置关区
customsHead.setReceiverID(customCode);
billsMap.put("billAutoId",billAutoId);
billsMap.put("billMasterNo",billMasterNo);
billsMap.put("billSecNo",billMasterNo +"_" +billSecNo);
billsMap.put("billType",billType);
bills.add(billsMap);
}
}
Context context = new Context();
context.setVariable("bills",bills);
context.setVariable("head",customsHead);
context.setVariable("flight",flightMap);
context.setVariable("reason",batchSend.businessAlterLog);
context.setLocale(Locale.SIMPLIFIED_CHINESE);
//生成的文件名
String fileName = messageID + ".xml";
//生成的报文路径,带斜杠
String filePath = saveXmlDir+fileName;
try {
File file = ResourceUtils.getFile(filePath);
/**
* 中文的地方在模板中要用utext,否则中文会被 escape 转义
*/
String xmlStr = templateEngine.process("mt2201/MT2201_D.xml",context);
System.out.println("xmlStr = " + xmlStr);
boolean valied = XSDValidateWithXML.validateXMLSchema("xsd/Manifest_Declare_Export_Air_Delete_2201_3.xsd",xmlStr);
if (valied){
// 生成报文
FileUtils.writeStringToFile(file,xmlStr, StandardCharsets.UTF_8);
log.info("[PRE-BATCH-SEND]-SUCCESS,批量删除发送成功");
// 更新运单状态,含主单表和分单表
Boolean b = updateBatchStatus(batchSend, bills, username);
return b;
}else {
return false;
}
} catch (Exception e) {
log.error("[PRE-BATCH-DEL]-批量删除发生异常,{}",e.getMessage());
return false;
}
}
private Boolean updateBatchStatus(BatchSend batchSend,ArrayList<Map> bills,String username) {
//存储更新主单状态的列表
ArrayList<PREPAREMASTER> preMasters = new ArrayList<>();
ArrayList<PREPARESECONDARY> preSubs = new ArrayList<>();
List<SENDLOG> sendlogList = new ArrayList<>();
for (Map<String,String> item : bills) {
// 批量插入发送日志
SENDLOG sendlog = new SENDLOG();
sendlog.setAutoid(UUID.randomUUID().toString());
sendlog.setMessageautoid(item.get("billAutoId"));
sendlog.setMessagetype(batchSend.businessAlterLog.getBusinesstype());
sendlog.setCreatedate(new Date());
sendlog.setReceiption("新舱单系统发送预配舱单批量删除报");
sendlog.setOpauthor(username);
sendlog.setSendpeice(new Long(0));
sendlog.setSendweight(new BigDecimal(0));
sendlogList.add(sendlog);
if ("master".equals(item.get("billType"))){
PREPAREMASTER preparemaster = new PREPAREMASTER();
preparemaster.setAutoid(item.get("billAutoId"));
preMasters.add(preparemaster);
}else {
PREPARESECONDARY preparesecondary = new PREPARESECONDARY();
preparesecondary.setAutoid(item.get("billAutoId"));
preSubs.add(preparesecondary);
}
}
int i = sendlogMapper.batchInsert(sendlogList);
if (i>0){
log.info("[PRE-BATCH-DEL-LOG-INSERT]-SUCCESS");
}else {
log.error("[PRE-BATCH-DEL-LOG-INSERT]-FAILD");
return false;
}
/**
* 以下两个批量更新语句无法返回具体影响行数,返回为-1
* 要么得配置在mybatis-config.xml,如下
* <configuration>
* <settings>
* <setting name="defaultExecutorType" value="SIMPLE"/>
* <setting name="defaultExecutorType" value="BATCH"/>
* </settings>
* </configuration>
*/
int i1 = preparemasterMapper.updateDelStatusByPrimaryKey(preMasters);
int i2 = preparesecondaryMapper.updateDelStatusByPrimaryKey(preSubs);
return true;
}
}
... ...
package com.tianbo.analysis.service.imp;
import com.tianbo.analysis.dao.ORIGINMANIFESTMASTERMapper;
import com.tianbo.analysis.dao.PREPAREMASTERMapper;
import com.tianbo.analysis.model.ORIGINMANIFESTMASTER;
import com.tianbo.analysis.model.PREPAREMASTER;
import com.tianbo.analysis.service.TransmissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by XYH on 2019/7/9.
*/
@Service
public class TransmissionImpl implements TransmissionService{
@Autowired
ORIGINMANIFESTMASTERMapper originmanifestmasterMapper;
@Autowired
PREPAREMASTERMapper preparemasterMapper;
@Override
public List<ORIGINMANIFESTMASTER> selectOrig(String start, String end) throws Exception {
return originmanifestmasterMapper.selectOrig(start,end);
}
@Override
public List<PREPAREMASTER> selectPre(String start, String end) throws Exception {
return preparemasterMapper.selectPre(start,end);
}
}
... ...
package com.tianbo.analysis.tools;
import lombok.extern.slf4j.Slf4j;
import org.xml.sax.SAXException;
import javax.xml.XMLConstants;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
@Slf4j
public class XSDValidateWithXML {
public static boolean validateXMLSchema(String xsdPath, String xmlStr) throws IOException {
ByteArrayInputStream bais = new ByteArrayInputStream(xmlStr.getBytes("UTF-8"));
try {
SchemaFactory factory =
SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = factory.newSchema(new File(xsdPath));
Validator validator = schema.newValidator();
Source source = new StreamSource(bais);
validator.validate(source);
} catch (IOException | SAXException e) {
e.printStackTrace();
log.error("Exception:{}",e.getMessage());
return false;
}finally {
bais.close();
}
return true;
}
}
... ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.tianbo.analysis.dao.BusinessAlterLogDao">
<resultMap id="BaseResultMap" type="com.tianbo.analysis.model.BusinessAlterLog">
<result column="AUTOID" jdbcType="VARCHAR" property="autoid" />
<result column="CREATEDATE" jdbcType="TIMESTAMP" property="createdate" />
<result column="BUSINESSTYPE" jdbcType="VARCHAR" property="businesstype" />
<result column="ALTER_REASON" jdbcType="VARCHAR" property="alterReason" />
<result column="CONTANTNAME" jdbcType="VARCHAR" property="contantname" />
<result column="CONTENTTEL" jdbcType="VARCHAR" property="contenttel" />
<result column="BILL_AUOTID" jdbcType="VARCHAR" property="billAuotid" />
</resultMap>
<sql id="Base_Column_List">
AUTOID, CREATEDATE, BUSINESSTYPE, ALTER_REASON, CONTANTNAME, CONTENTTEL, BILL_AUOTID
</sql>
<insert id="insert" parameterType="com.tianbo.analysis.model.BusinessAlterLog">
insert into BUSINESS_ALTER_LOG (AUTOID, CREATEDATE, BUSINESSTYPE,
ALTER_REASON, CONTANTNAME, CONTENTTEL,
BILL_AUOTID)
values (#{autoid,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP}, #{businesstype,jdbcType=VARCHAR},
#{alterReason,jdbcType=VARCHAR}, #{contantname,jdbcType=VARCHAR}, #{contenttel,jdbcType=VARCHAR},
#{billAuotid,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.tianbo.analysis.model.BusinessAlterLog">
insert into BUSINESS_ALTER_LOG
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="autoid != null">
AUTOID,
</if>
<if test="createdate != null">
CREATEDATE,
</if>
<if test="businesstype != null">
BUSINESSTYPE,
</if>
<if test="alterReason != null">
ALTER_REASON,
</if>
<if test="contantname != null">
CONTANTNAME,
</if>
<if test="contenttel != null">
CONTENTTEL,
</if>
<if test="billAuotid != null">
BILL_AUOTID,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="autoid != null">
#{autoid,jdbcType=VARCHAR},
</if>
<if test="createdate != null">
#{createdate,jdbcType=TIMESTAMP},
</if>
<if test="businesstype != null">
#{businesstype,jdbcType=VARCHAR},
</if>
<if test="alterReason != null">
#{alterReason,jdbcType=VARCHAR},
</if>
<if test="contantname != null">
#{contantname,jdbcType=VARCHAR},
</if>
<if test="contenttel != null">
#{contenttel,jdbcType=VARCHAR},
</if>
<if test="billAuotid != null">
#{billAuotid,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="update" parameterType="com.tianbo.analysis.model.BusinessAlterLog">
update BUSINESS_ALTER_LOG
set CREATEDATE = #{createdate,jdbcType=TIMESTAMP},
BUSINESSTYPE = #{businesstype,jdbcType=VARCHAR},
ALTER_REASON = #{alterReason,jdbcType=VARCHAR},
CONTANTNAME = #{contantname,jdbcType=VARCHAR},
CONTENTTEL = #{contenttel,jdbcType=VARCHAR},
BILL_AUOTID = #{billAuotid,jdbcType=VARCHAR}
where AUTOID = #{autoid,jdbcType=VARCHAR}
</update>
<update id="updateSelective" parameterType="com.tianbo.analysis.model.BusinessAlterLog">
update BUSINESS_ALTER_LOG
<set>
<if test="createdate != null">CREATEDATE = #{createdate,jdbcType=TIMESTAMP},</if>
<if test="businesstype != null">BUSINESSTYPE = #{businesstype,jdbcType=VARCHAR},</if>
<if test="alterReason != null">ALTER_REASON = #{alterReason,jdbcType=VARCHAR},</if>
<if test="contantname != null">CONTANTNAME = #{contantname,jdbcType=VARCHAR},</if>
<if test="contenttel != null">CONTENTTEL = #{contenttel,jdbcType=VARCHAR},</if>
<if test="billAuotid != null">BILL_AUOTID = #{billAuotid,jdbcType=VARCHAR},</if>
</set>
where AUTOID = #{autoid,jdbcType=VARCHAR}
</update>
<select id="selectByBillAutoidAndType" parameterType="com.tianbo.analysis.model.BusinessAlterLog" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from BUSINESS_ALTER_LOG
where BILL_AUOTID = #{billAuotid,jdbcType=VARCHAR}
and BUSINESSTYPE = #{businesstype,jdbcType=VARCHAR}
</select>
</mapper>
... ...
... ... @@ -56,7 +56,7 @@
<include refid="Base_Column_List" />
from
MANIFEST_AIR_CHANGE
where 1=1
<where>
<if test="flightno != null and flightno != ''">
and FLIGHTNO = #{flightno,jdbcType=VARCHAR}
</if>
... ... @@ -66,6 +66,7 @@
<if test="waybillnomaster != null and waybillnomaster != ''">
AND WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</if>
</where>
) t1
LEFT JOIN (
SELECT
... ... @@ -81,8 +82,7 @@
) t2 ON t1.AUTOID = t2.MESSAGEAUTOID
AND t2.rn = 1
) t3
where 1=1
order by CREATEDATE desc
order by FLIGHT_DATE desc
</select>
<select id="selectListByAutoIDS" resultMap="BaseResultMap" parameterType="java.util.List" >
... ...
... ... @@ -47,6 +47,9 @@
<result column="SPECIFIC_CONSIGNEE_PHONE" property="specificConsigneePhone" jdbcType="VARCHAR"/>
<result column="CONSIGNEE_PHONE" property="consigneePhone" jdbcType="VARCHAR"/>
<result column="messagetype" property="messagetype" jdbcType="VARCHAR"/>
<result column="NUM" property="num" jdbcType="VARCHAR"/>
<result column="FLIGHT" property="flight" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
AUTOID, WAYBILLNOMASTER, FLIGHTNO, FLIGHT_DATE
... ... @@ -676,4 +679,10 @@ GROUP BY
where AUTOID = #{autoid,jdbcType=VARCHAR}
</update>
<select id="selectOrig" resultMap="BaseResultMap" >
select flight,count(*) as num from (select o.*,substr(flightno,1,2) as flight from ORIGINMANIFESTMASTER o where destinationstation='CGO')
where flight_date BETWEEN to_date(#{param1},'yyyy/MM/dd')
and to_date(#{param2},'yyyy/MM/dd') group by flight
</select>
</mapper>
... ...
... ... @@ -41,6 +41,8 @@
<result column="CONSIGNEE_AEO" property="consigneeAeo" jdbcType="VARCHAR" />
<result column="UNLOADINGSTATION" property="unloadingstation" jdbcType="VARCHAR" />
<result column="ARRIVED_AHEAD" property="arrivedAhead" jdbcType="VARCHAR" />
<result column="FLIGHT" property="flight" jdbcType="VARCHAR"/>
<result column="NUM" property="num" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List" >
AUTOID, FLIGHTNO, FLIGHTDATE, ORIGINATINGSTATION, DESTINATIONSTATION, WAYBILLNOMASTER,
... ... @@ -574,6 +576,16 @@
where WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR}
</update>
<update id="updateDelStatusByPrimaryKey" parameterType="java.util.List">
BEGIN
<foreach collection="list" item="item" index="index" separator=";">
UPDATE CGONMS.PREPAREMASTER
SET STATUS = '08'
WHERE AUTOID = #{item.autoid,jdbcType=VARCHAR}
</foreach>
;END;
</update>
<select id="searchTree" resultMap="TreeMap">
select * from(
SELECT
... ... @@ -734,4 +746,11 @@ select * from(
from tallysecondary
where tallymasterID= #{autoid}
</select>
<select id="selectPre" resultMap="BaseResultMap" >
select carrier as FLIGHT,count(*) as NUM from PREPAREMASTER where ORIGINATINGSTATION='CGO'
AND FLIGHTDATE between to_date(#{param1},'yyyy/MM/dd')
and to_date(#{param2},'yyyy/MM/dd')
group by carrier
</select>
</mapper>
... ...
... ... @@ -59,6 +59,13 @@
where AUTOID = #{autoid,jdbcType=VARCHAR}
</select>
<select id="selectByPrimaryKeys" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from CGONMS.PREPARESECONDARY
where AUTOID in (#{autoid,jdbcType=VARCHAR})
</select>
<select id="selectByMasterKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
... ... @@ -469,6 +476,17 @@
</set>
where AUTOID = #{autoid,jdbcType=VARCHAR}
</update>
<update id="updateDelStatusByPrimaryKey" parameterType="java.util.List" >
BEGIN
<foreach collection="list" item="item" index="index" separator=";">
UPDATE CGONMS.PREPARESECONDARY
SET STATUS = '08'
WHERE AUTOID = #{item.autoid,jdbcType=VARCHAR}
</foreach>
;END;
</update>
<update id="updateByPrimaryKey" parameterType="com.tianbo.analysis.model.PREPARESECONDARY" >
update CGONMS.PREPARESECONDARY
set WAYBILLNOMASTER = #{waybillnomaster,jdbcType=VARCHAR},
... ...
... ... @@ -106,4 +106,23 @@ WHERE
</if>
</trim>
</insert>
<insert id="batchInsert" parameterType="java.util.List">
insert into CGONMS.SENDLOG
(AUTOID, CREATEDATE, OPAUTHOR, SENDPEICE, SENDWEIGHT, RECEIPTION, MESSAGETYPE, MESSAGEAUTOID)
<foreach collection="list" item="item" separator="union all" open="(" close=")">
select
<trim suffixOverrides=",">
#{item.autoid,jdbcType=VARCHAR},
#{item.createdate,jdbcType=TIMESTAMP},
#{item.opauthor,jdbcType=VARCHAR},
#{item.sendpeice,jdbcType=DECIMAL},
#{item.sendweight,jdbcType=DECIMAL},
#{item.receiption,jdbcType=VARCHAR},
#{item.messagetype,jdbcType=VARCHAR},
#{item.messageautoid,jdbcType=VARCHAR}
</trim>
from dual
</foreach>
</insert>
</mapper>
... ...
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
... ...
node_modules/
.idea
*.iml
atlassian-ide-plugin.xml
yuicompressor-*
... ...
{
"bitwise": false,
"camelcase": false,
"curly": false,
"eqeqeq": true,
"es3": false,
"forin": false,
"freeze": false,
"immed": false,
"sub": true,
"latedef": false,
"newcap": false,
"noarg": false,
"node": true,
"laxbreak": true,
"noempty": true,
"varstmt": false,
"nonbsp": true,
"nonew": false,
"plusplus": false,
"quotmark": "single",
"undef": true,
"unused": true,
"esversion": 6,
"strict": false,
"trailing": true,
"browser": false,
"asi": true,
"predef": ["window","document","jQuery","define"]
}
... ...
# PHP Storm
.idea
*.iml
atlassian-ide-plugin.xml
yuicompressor-*
build
less
sample*
screenshot
... ...
sudo: false
before_script:
- cd ./tests
- echo "new Date().toString();" | phantomjs
script: phantomjs run-qunit.js tests.html
... ...
module.exports = (grunt) => {
require('load-grunt-tasks')(grunt)
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: {
src: ['./js/bootstrap-datetimepicker.js']
}
},
versioncheck: {
target: {
options: {
hideUpToDate: true
}
}
}
})
grunt.registerTask('default', ['jshint', 'versioncheck'])
}
... ...
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2012 Sebastien MALOT
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
... ...
# Deprecation warning!
We are going to move this project to [this repository](https://github.com/AuspeXeu/bootstrap-datetimepicker). Please do not file new issues or pull requests!
# Project : bootstrap-datetimepicker
======================================
[![Build Status](https://travis-ci.org/smalot/bootstrap-datetimepicker.svg?branch=master)](https://travis-ci.org/smalot/bootstrap-datetimepicker)
[Homepage](http://www.malot.fr/bootstrap-datetimepicker/)
[Demo page](http://www.malot.fr/bootstrap-datetimepicker/demo.php)
# Project forked
This project is a fork of [bootstrap-datepicker project](https://github.com/eternicode/bootstrap-datepicker).
# Home
As 'bootstrap-datepicker' is restricted to the date scope (day, month, year), this project aims to support too the time picking (hour, minutes).
# Screenshots
## Decade year view
![Datetimepicker decade year view](https://raw.github.com/smalot/bootstrap-datetimepicker/master/screenshot/standard_decade.png)
This view allows to select the day in the selected month.
## Year view
![Datetimepicker year view](https://raw.github.com/smalot/bootstrap-datetimepicker/master/screenshot/standard_year.png)
This view allows to select the month in the selected year.
## Month view
![Datetimepicker month view](https://raw.github.com/smalot/bootstrap-datetimepicker/master/screenshot/standard_month.png)
This view allows to select the year in a range of 10 years.
## Day view
![Datetimepicker day view](https://raw.github.com/smalot/bootstrap-datetimepicker/master/screenshot/standard_day.png)
This view allows to select the hour in the selected day.
## Hour view
![Datetimepicker hour view](https://raw.github.com/smalot/bootstrap-datetimepicker/master/screenshot/standard_hour.png)
This view allows to select the preset of minutes in the selected hour.
The range of 5 minutes (by default) has been selected to restrict buttons quantity to an acceptable value, but it can be overrided by the <code>minuteStep</code> property.
## Day view - meridian
![Datetimepicker day view meridian](https://raw.github.com/smalot/bootstrap-datetimepicker/master/screenshot/standard_day_meridian.png)
Meridian is supported in both the day and hour views.
To use it, just enable the <code>showMeridian</code> property.
## Hour view - meridian
![Datetimepicker hour view meridian](https://raw.github.com/smalot/bootstrap-datetimepicker/master/screenshot/standard_hour_meridian.png)
# Example
Attached to a field with the format specified via options:
```html
<input type="text" value="2012-05-15 21:05" id="datetimepicker">
```
```javascript
$('#datetimepicker').datetimepicker({
format: 'yyyy-mm-dd hh:ii'
});
```
Attached to a field with the format specified via markup:
```html
<input type="text" value="2012-05-15 21:05" id="datetimepicker" data-date-format="yyyy-mm-dd hh:ii">
```
```javascript
$('#datetimepicker').datetimepicker();
```
As component:
```html
<div class="input-append date" id="datetimepicker" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
<input size="16" type="text" value="12-02-2012" readonly>
<span class="add-on"><i class="icon-th"></i></span>
</div>
```
```javascript
$('#datetimepicker').datetimepicker();
```
As inline datetimepicker:
```html
<div id="datetimepicker"></div>
```
```javascript
$('#datetimepicker').datetimepicker();
```
# Using bootstrap-datetimepicker.js
Call the datetimepicker via javascript:
```javascript
$('.datetimepicker').datetimepicker()
```
## Dependencies
Requires bootstrap's dropdown component (`dropdowns.less`) for some styles, and bootstrap's sprites (`sprites.less` and associated images) for arrows.
A standalone .css file (including necessary dropdown styles and alternative, text-based arrows) can be generated by running `build/build_standalone.less` through the `lessc` compiler:
```bash
$ lessc build/build_standalone.less > datetimepicker.css
```
## Options
All options that take a "Date" can handle a `Date` object; a String formatted according to the given `format`; or a timedelta relative to today, eg '-1d', '+6m +1y', etc, where valid units are 'd' (day), 'w' (week), 'm' (month), and 'y' (year).
You can also specify an ISO-8601 valid datetime, despite of the given `format` :
* yyyy-mm-dd
* yyyy-mm-dd hh:ii
* yyyy-mm-ddThh:ii
* yyyy-mm-dd hh:ii:ss
* yyyy-mm-ddThh:ii:ssZ
### format
String. Default: 'mm/dd/yyyy'
The date format, combination of p, P, h, hh, i, ii, s, ss, d, dd, m, mm, M, MM, yy, yyyy.
* p : meridian in lower case ('am' or 'pm') - according to locale file
* P : meridian in upper case ('AM' or 'PM') - according to locale file
* s : seconds without leading zeros
* ss : seconds, 2 digits with leading zeros
* i : minutes without leading zeros
* ii : minutes, 2 digits with leading zeros
* h : hour without leading zeros - 24-hour format
* hh : hour, 2 digits with leading zeros - 24-hour format
* H : hour without leading zeros - 12-hour format
* HH : hour, 2 digits with leading zeros - 12-hour format
* d : day of the month without leading zeros
* dd : day of the month, 2 digits with leading zeros
* m : numeric representation of month without leading zeros
* mm : numeric representation of the month, 2 digits with leading zeros
* M : short textual representation of a month, three letters
* MM : full textual representation of a month, such as January or March
* yy : two digit representation of a year
* yyyy : full numeric representation of a year, 4 digits
* t : unix epoch timestamp
* Z : abbreviated timezone name
### weekStart
Integer. Default: 0
Day of the week start. 0 (Sunday) to 6 (Saturday)
### startDate
Date. Default: Beginning of time
The earliest date that may be selected; all earlier dates will be disabled.
### endDate
Date. Default: End of time
The latest date that may be selected; all later dates will be disabled.
### daysOfWeekDisabled
String, Array. Default: '', []
Days of the week that should be disabled. Values are 0 (Sunday) to 6 (Saturday). Multiple values should be comma-separated. Example: disable weekends: `'0,6'` or `[0,6]`.
### autoclose
Boolean. Default: false
Whether or not to close the datetimepicker immediately when a date is selected.
### startView
Number, String. Default: 2, 'month'
The view that the datetimepicker should show when it is opened.
Accepts values of :
* 0 or 'hour' for the hour view
* 1 or 'day' for the day view
* 2 or 'month' for month view (the default)
* 3 or 'year' for the 12-month overview
* 4 or 'decade' for the 10-year overview. Useful for date-of-birth datetimepickers.
### minView
Number, String. Default: 0, 'hour'
The lowest view that the datetimepicker should show.
### maxView
Number, String. Default: 4, 'decade'
The highest view that the datetimepicker should show.
### clearBtn
Boolean. Default: false
If true, displays a "Clear" button at the bottom of the datetimepicker to clear the current selection. Moreover, the datetimepicker will be closed if autoclose is set to true.
### todayBtn
Boolean, "linked". Default: false
If true or "linked", displays a "Today" button at the bottom of the datetimepicker to select the current date. If true, the "Today" button will only move the current date into view; if "linked", the current date will also be selected.
### todayHighlight
Boolean. Default: false
If true, highlights the current date.
### keyboardNavigation
Boolean. Default: true
Whether or not to allow date navigation by arrow keys.
### language
String. Default: 'en'
The two-letter code of the language to use for month and day names. These will also be used as the input's value (and subsequently sent to the server in the case of form submissions). Currently ships with English ('en'), German ('de'), Brazilian ('br'), and Spanish ('es') translations, but others can be added (see I18N below). If an unknown language code is given, English will be used.
### forceParse
Boolean. Default: true
Whether or not to force parsing of the input value when the picker is closed. That is, when an invalid date is left in the input field by the user, the picker will forcibly parse that value, and set the input's value to the new, valid date, conforming to the given `format`.
### bootcssVer
Number.
You can override the auto-detect functionality of the different bootstrap versions (e.g., 2 or 3) by using this option.
### minuteStep
Number. Default: 5
The increment used to build the hour view. A button is created for each <code>minuteStep</code> minutes.
### pickerReferer : deprecated
String. Default: 'default'
The referer element to place the picker for the component implementation. If you want to place the picker just under the input field, just specify <code>input</code>.
### pickerPosition
String. Default: 'bottom-right' (supported values are: 'bottom-right', 'bottom-left', 'top-right', 'top-left')
This option allows to place the picker just under the input field for the component implementation instead of the default position which is at the bottom right of the button.
### viewSelect
Number or String. Default: <code>same as minView</code> (supported values are: 'decade', 'year', 'month', 'day', 'hour')
With this option you can select the view from which the date will be selected. By default it's the last one, however you can choose the first one, so at each click the date will be updated.
### showMeridian
Boolean. Default: false
This option will enable meridian views for day and hour views.
### initialDate
Date or String. Default: new Date()
You can initialize the viewer with a date. By default it's now, so you can specify yesterday or today at midnight ...
### zIndex
Number. Default: undefined
zIndex value is being automatically calculated based on the DOM tree, where we seek the highest value. To skip this process you can set the value manually.
### timezone
String. Default: Clients current timezone abbreviated name
You can allow the viewer to display the date along with the given timezone. Note that this has to be used in conjunction with the `Z` format option. Example below:
```javascript
$('#date-end').datetimepicker({
format: 'yyyy-mm-dd hh:ii P Z'
timezone: 'GMT'
});
```
![](http://s32.postimg.org/55x4fud05/Screen_Shot_2016_05_17_at_5_43_34_PM.png)
### onRenderYear
This event is fired when a year is rendered inside the datepicker. Should return an array of classes to add to this element. Return ['disabled'] to disable the day from being selected.
```javascript
$('#date')
.datetimepicker({
onRenderYear: function(date) {
//Disable picking dates from any year apart from 2015/2016
if (date.getFullYear() < 2015 || date.getFullYear() > 2016)
return ['disabled']
}
});
```
### onRenderMonth
This event is fired when a month is rendered inside the datepicker. Should return an array of classes to add to this element. Return ['disabled'] to disable the day from being selected.
```javascript
$('#date')
.datetimepicker({
onRenderMonth: function(date) {
//Disable every other month in the year 2016
if (date.getUTCMonth() % 2 === 0 && date.getUTCFullYear() === 2016)
return ['disabled']
}
});
```
### onRenderDay
This event is fired when a day is rendered inside the datepicker. Should return an array of classes to add to this element. Return ['disabled'] to disable the day from being selected.
```javascript
$('#date')
.datetimepicker({
onRenderDay: function(date) {
//Disable dates 18-24 of every month
if (date.getDate() >= 18 && date.getDate() <= 24)
return ['disabled'];
}
});
```
### onRenderHour
This event is fired when a hour is rendered inside the datepicker. Should return an array of classes to add to this element. Return ['disabled'] to disable the day from being selected.
```javascript
$('#date')
.datetimepicker({
onRenderHour: function(hour) {
//Disable any time between 12:00 and 13:59
if (date.getUTCHours() === 12 || date.getUTCHours() === 13)
return ['disabled'];
}
});
```
### onRenderMinute
This event is fired when a minute is rendered inside the datepicker. Should return an array of classes to add to this element. Return ['disabled'] to disable the day from being selected.
```javascript
$('#date')
.datetimepicker({
onRenderMinute: function(minute) {
//Disable all times between 30 past and 20 to every hour for workdays
if (date.getDay() !== 0 && date.getDay() !== 6 && date.getUTCMinutes() >= 30 && date.getUTCMinutes() <= 40)
return ['disabled'];
}
});
```
### fontAwesome
Boolean. Default: false
If true, [Font Awesome](http://fontawesome.io/) will be used.
## Markup
Format as component.
```html
<div class="input-append date" id="datetimepicker" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
<input class="span2" size="16" type="text" value="12-02-2012">
<span class="add-on"><i class="icon-th"></i></span>
</div>
```
Format as component with reset button to clear the input field.
```html
<div class="input-append date" id="datetimepicker" data-date="12-02-2012" data-date-format="dd-mm-yyyy">
<input class="span2" size="16" type="text" value="12-02-2012">
<span class="add-on"><i class="icon-remove"></i></span>
<span class="add-on"><i class="icon-th"></i></span>
</div>
```
## Methods
### .datetimepicker(options)
Initializes an datetimepicker.
### remove
Arguments: None
Remove the datetimepicker. Removes attached events, internal attached objects, and
added HTML elements.
$('#datetimepicker').datetimepicker('remove');
### show
Arguments: None
Show the datetimepicker.
```javascript
$('#datetimepicker').datetimepicker('show');
```
### hide
Arguments: None
Hide the datetimepicker.
```javascript
$('#datetimepicker').datetimepicker('hide');
```
### update
Arguments:
* currentDate (Date).
Update the datetimepicker with the specified date.
```javascript
$('#datetimepicker').datetimepicker('update', new Date());
```
Omit currentDate to update the datetimepicker with the current input value.
```javascript
$('#datetimepicker').datetimepicker('update');
```
### setStartDate
Arguments:
* startDate (String)
Sets a new lower date limit on the datetimepicker.
```javascript
$('#datetimepicker').datetimepicker('setStartDate', '2012-01-01');
```
Omit startDate (or provide an otherwise falsey value) to unset the limit.
```javascript
$('#datetimepicker').datetimepicker('setStartDate');
$('#datetimepicker').datetimepicker('setStartDate', null);
```
### setEndDate
Arguments:
* endDate (String)
Sets a new upper date limit on the datetimepicker.
```javascript
$('#datetimepicker').datetimepicker('setEndDate', '2012-12-31');
```
Omit endDate (or provide an otherwise falsey value) to unset the limit.
```javascript
$('#datetimepicker').datetimepicker('setEndDate');
$('#datetimepicker').datetimepicker('setEndDate', null);
```
### setDaysOfWeekDisabled
Arguments:
* daysOfWeekDisabled (String|Array)
Sets the days of week that should be disabled.
```javascript
$('#datetimepicker').datetimepicker('setDaysOfWeekDisabled', [0,6]);
```
Omit daysOfWeekDisabled (or provide an otherwise falsey value) to unset the disabled days.
```javascript
$('#datetimepicker').datetimepicker('setDaysOfWeekDisabled');
$('#datetimepicker').datetimepicker('setDaysOfWeekDisabled', null);
```
### setMinutesDisabled
Arguments:
* minutesDisabled (String|Array)
Sets the minutes that should be disabled.
```javascript
$('#datetimepicker').datetimepicker('setMinutesDisabled', [25,59]);
```
Omit minutesDisabled (or provide an otherwise falsey value) to unset the disabled minutes.
```javascript
$('#datetimepicker').datetimepicker('setMinutesDisabled');
$('#datetimepicker').datetimepicker('setMinutesDisabled', null);
```
### setHoursDisabled
Arguments:
* hoursDisabled (String|Array)
Sets the hours that should be disabled.
```javascript
$('#datetimepicker').datetimepicker('setHoursDisabled', [12,19]);
```
Omit hoursDisabled (or provide an otherwise falsey value) to unset the disabled hours.
```javascript
$('#datetimepicker').datetimepicker('setHoursDisabled');
$('#datetimepicker').datetimepicker('setHoursDisabled', null);
```
### setInitialDate
Arguments:
* setInitialDate (String)
Sets a new inital date on the datetimepicker.
```javascript
$('#datetimepicker').datetimepicker('setInitialDate', '2012-12-31');
```
Get the inital date on the datetimepicker.
```javascript
$('#datetimepicker').datetimepicker('getInitialDate');
```
## Events
Datetimepicker class exposes a few events for manipulating the dates.
### show
Fired when the date picker is displayed.
### hide
Fired when the date picker is hidden.
### changeDate
Fired when the date is changed.
```javascript
$('#date-end')
.datetimepicker()
.on('changeDate', function(ev){
if (ev.date.valueOf() < date-start-display.valueOf()){
....
}
});
```
### changeYear
Fired when the *view* year is changed from decade view.
### changeMonth
Fired when the *view* month is changed from year view.
### outOfRange
Fired when you pick a date before the *startDate* or after the *endDate* or when you specify a date via the method *setDate* or *setUTCDate*..
### next:* / prev:*
Fired when you click the *next* or *previous* arrows. Supports all the differnt view modes ('year', 'month', 'day', 'hour'). For example allows you to bind a callback to 'next:month' or 'prev:month' action.
## Keyboard support
The datetimepicker includes some keyboard navigation:
### up, down, left, right arrow keys
By themselves, left/right will move backward/forward one day, up/down will move back/forward one week.
With the shift key, up/left will move backward one month, down/right will move forward one month.
With the ctrl key, up/left will move backward one year, down/right will move forward oone year.
Shift+ctrl behaves the same as ctrl -- that is, it does not change both month and year simultaneously, only the year.
### escape
The escape key can be used to hide and re-show the datetimepicker; this is necessary if the user wants to manually edit the value.
### enter
When the picker is visible, enter will simply hide it. When the picker is not visible, enter will have normal effects -- submitting the current form, etc.
## Mouse Wheel View Navigation
In order to make this plugin easier to set different part of date time, mouse wheel has been used to navigate through different views. Scroll up your mouse wheel to navigate to the decade year view. Scroll down will lead to the minute view.
### Dependency
To enalbe this feature. [jQuery Mouse Wheel Plugin](https://github.com/brandonaaron/jquery-mousewheel) must be included before using this feature.
### Options
#### wheelViewModeNavigation
Boolean. Default: false
Whether or not to enable navigating through different view mode using mouse wheel.
#### wheelViewModeNavigationInverseDirection
Boolean. Default: false
Whether or not to reverse the direction of scrolling. Default is scroll up to the decade view.
#### wheelViewModeNavigationDelay
Integer. Default: 100
Time delays between the next respond to the wheel command, it controls the speed between switching in different views. Unit is in million seconds.
#### About viewSelect option
The recommended value for viewSelect option is 4 when this feature is enable. That means you can easily update any the value in every view. This option value is applied in the demo page.
### Feature Demo
A simple [Demo](http://lyonlai.github.io/bootstrap-datetimepicker/demo.html) page is given to show it's simple idea.
## I18N
The plugin supports i18n for the month and weekday names and the `weekStart` option. The default is English ('en'); other available translations are avilable in the `js/locales/` directory, simply include your desired locale after the plugin. To add more languages, simply add a key to `$.fn.datetimepicker.dates`, before calling `.datetimepicker()`. Example:
```javascript
$.fn.datetimepicker.dates['en'] = {
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],
daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
today: "Today"
};
```
You can override the default date format in the language configuration with `format` attribute.
Example:
```javascript
$.fn.datetimepicker.dates['pt-BR'] = {
format: 'dd/mm/yyyy'
};
```
Right-to-left languages may also include `rtl: true` to make the calendar display appropriately.
If your browser (or those of your users) is displaying characters wrong, chances are the browser is loading the javascript file with a non-unicode encoding. Simply add `charset="UTF-8"` to your `script` tag:
```html
<script type="text/javascript" src="bootstrap-datetimepicker.de.js" charset="UTF-8"></script>
```
... ...
{
"name": "smalot-bootstrap-datetimepicker",
"main": ["js/bootstrap-datetimepicker.min.js", "css/bootstrap-datetimepicker.min.css"],
"ignore": [
"build",
"sample in bootstrap v2",
"sample in bootstrap v3",
"screenshot",
"tests",
".gitattributes",
".gitignore",
".travis.yml",
"minify.sh"
]
}
... ...
// Datepicker .less buildfile. Includes select mixins/variables from bootstrap
// and imports the included datepicker.less to output a minimal datepicker.css
//
// Usage:
// lessc build.less datepicker.css
//
// Variables and mixins copied from bootstrap 2.0.2
// Variables
@grayLight: #999;
@grayLighter: #eee;
@white: #fff;
@linkColor: #08c;
@btnPrimaryBackground: @linkColor;
@orange: #f89406;
// Mixins
// Border Radius
.border-radius(@radius: 5px) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
// Button backgrounds
.buttonBackground(@startColor, @endColor) {
.gradientBar(@startColor, @endColor);
.reset-filter();
&:hover, &:active, &.active, &.disabled, &[disabled] {
background-color: @endColor;
}
&:active,
&.active {
background-color: darken(@endColor, 10%) e("\9");
}
}
// Reset filters for IE
.reset-filter() {
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
// Gradient Bar Colors for buttons and alerts
.gradientBar(@primaryColor, @secondaryColor) {
#gradient > .vertical(@primaryColor, @secondaryColor);
border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);
border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
}
// Gradients
#gradient {
.vertical(@startColor: #555, @endColor: #333) {
background-color: mix(@startColor, @endColor, 60%);
background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
background-image: -ms-linear-gradient(top, @startColor, @endColor); // IE10
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
background-image: linear-gradient(top, @startColor, @endColor); // The standard
background-repeat: repeat-x;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@startColor,@endColor)); // IE9 and down
}
}
@import "../less/datetimepicker.less";
... ...
// Datepicker standalone .less buildfile. Includes all necessary mixins/variables/rules from bootstrap
// and imports the included datepicker.less to output a minimal standalone datepicker.css
//
// Usage:
// lessc build_standalone.less datepicker.css
//
// Variables, mixins, and rules copied from bootstrap 2.0.2
@import "build.less";
// Dropdown css
@zindexDropdown: 1000;
@grayDark: #333;
@baseLineHeight: 18px;
@tableBackground: transparent; // overall background-color
@dropdownBackground: @white;
@dropdownBorder: rgba(0,0,0,.2);
@dropdownLinkColor: @grayDark;
@dropdownLinkColorHover: @white;
@dropdownLinkBackgroundHover: @linkColor;
// Drop shadows
.box-shadow(@shadow) {
-webkit-box-shadow: @shadow;
-moz-box-shadow: @shadow;
box-shadow: @shadow;
}
// The dropdown menu (ul)
// ----------------------
.datetimepicker.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
z-index: @zindexDropdown;
float: left;
display: none; // none by default, but block on "open" of the menu
min-width: 160px;
list-style: none;
background-color: @dropdownBackground;
border: 1px solid #ccc;
border: 1px solid rgba(0,0,0,.2);
.border-radius(5px);
.box-shadow(0 5px 10px rgba(0,0,0,.2));
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
*border-right-width: 2px;
*border-bottom-width: 2px;
// Normally inherited from bootstrap's `body`
color: #333333;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-size:13px;
line-height: @baseLineHeight;
th, td {
padding: 4px 5px;
}
}
// Alternative arrows
// May require `charset="UTF-8"` in your `<link>` tag
.datetimepicker {
.prev, .next {font-style:normal;}
.prev:after {content:"«";}
.next:after {content:"»";}
}
... ...
/*!
* Datetimepicker for Bootstrap
*
* Copyright 2012 Stefan Petre
* Improvements by Andrew Rowls
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
.datetimepicker {
padding: 4px;
margin-top: 1px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
direction: ltr;
}
.datetimepicker-inline {
width: 220px;
}
.datetimepicker.datetimepicker-rtl {
direction: rtl;
}
.datetimepicker.datetimepicker-rtl table tr td span {
float: right;
}
.datetimepicker-dropdown, .datetimepicker-dropdown-left {
top: 0;
left: 0;
}
[class*=" datetimepicker-dropdown"]:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #cccccc;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
}
[class*=" datetimepicker-dropdown"]:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #ffffff;
position: absolute;
}
[class*=" datetimepicker-dropdown-top"]:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 7px solid #cccccc;
border-top-color: rgba(0, 0, 0, 0.2);
border-bottom: 0;
}
[class*=" datetimepicker-dropdown-top"]:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #ffffff;
border-bottom: 0;
}
.datetimepicker-dropdown-bottom-left:before {
top: -7px;
right: 6px;
}
.datetimepicker-dropdown-bottom-left:after {
top: -6px;
right: 7px;
}
.datetimepicker-dropdown-bottom-right:before {
top: -7px;
left: 6px;
}
.datetimepicker-dropdown-bottom-right:after {
top: -6px;
left: 7px;
}
.datetimepicker-dropdown-top-left:before {
bottom: -7px;
right: 6px;
}
.datetimepicker-dropdown-top-left:after {
bottom: -6px;
right: 7px;
}
.datetimepicker-dropdown-top-right:before {
bottom: -7px;
left: 6px;
}
.datetimepicker-dropdown-top-right:after {
bottom: -6px;
left: 7px;
}
.datetimepicker > div {
display: none;
}
.datetimepicker.minutes div.datetimepicker-minutes {
display: block;
}
.datetimepicker.hours div.datetimepicker-hours {
display: block;
}
.datetimepicker.days div.datetimepicker-days {
display: block;
}
.datetimepicker.months div.datetimepicker-months {
display: block;
}
.datetimepicker.years div.datetimepicker-years {
display: block;
}
.datetimepicker table {
margin: 0;
}
.datetimepicker td,
.datetimepicker th {
text-align: center;
width: 20px;
height: 20px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: none;
}
.table-striped .datetimepicker table tr td,
.table-striped .datetimepicker table tr th {
background-color: transparent;
}
.datetimepicker table tr td.minute:hover {
background: #eeeeee;
cursor: pointer;
}
.datetimepicker table tr td.hour:hover {
background: #eeeeee;
cursor: pointer;
}
.datetimepicker table tr td.day:hover {
background: #eeeeee;
cursor: pointer;
}
.datetimepicker table tr td.old,
.datetimepicker table tr td.new {
color: #999999;
}
.datetimepicker table tr td.disabled,
.datetimepicker table tr td.disabled:hover {
background: none;
color: #999999;
cursor: default;
}
.datetimepicker table tr td.today,
.datetimepicker table tr td.today:hover,
.datetimepicker table tr td.today.disabled,
.datetimepicker table tr td.today.disabled:hover {
background-color: #fde19a;
background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
background-image: linear-gradient(to bottom, #fdd49a, #fdf59a);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
border-color: #fdf59a #fdf59a #fbed50;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
}
.datetimepicker table tr td.today:hover,
.datetimepicker table tr td.today:hover:hover,
.datetimepicker table tr td.today.disabled:hover,
.datetimepicker table tr td.today.disabled:hover:hover,
.datetimepicker table tr td.today:active,
.datetimepicker table tr td.today:hover:active,
.datetimepicker table tr td.today.disabled:active,
.datetimepicker table tr td.today.disabled:hover:active,
.datetimepicker table tr td.today.active,
.datetimepicker table tr td.today:hover.active,
.datetimepicker table tr td.today.disabled.active,
.datetimepicker table tr td.today.disabled:hover.active,
.datetimepicker table tr td.today.disabled,
.datetimepicker table tr td.today:hover.disabled,
.datetimepicker table tr td.today.disabled.disabled,
.datetimepicker table tr td.today.disabled:hover.disabled,
.datetimepicker table tr td.today[disabled],
.datetimepicker table tr td.today:hover[disabled],
.datetimepicker table tr td.today.disabled[disabled],
.datetimepicker table tr td.today.disabled:hover[disabled] {
background-color: #fdf59a;
}
.datetimepicker table tr td.today:active,
.datetimepicker table tr td.today:hover:active,
.datetimepicker table tr td.today.disabled:active,
.datetimepicker table tr td.today.disabled:hover:active,
.datetimepicker table tr td.today.active,
.datetimepicker table tr td.today:hover.active,
.datetimepicker table tr td.today.disabled.active,
.datetimepicker table tr td.today.disabled:hover.active {
background-color: #fbf069;
}
.datetimepicker table tr td.active,
.datetimepicker table tr td.active:hover,
.datetimepicker table tr td.active.disabled,
.datetimepicker table tr td.active.disabled:hover {
background-color: #006dcc;
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
background-image: linear-gradient(to bottom, #0088cc, #0044cc);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
border-color: #0044cc #0044cc #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datetimepicker table tr td.active:hover,
.datetimepicker table tr td.active:hover:hover,
.datetimepicker table tr td.active.disabled:hover,
.datetimepicker table tr td.active.disabled:hover:hover,
.datetimepicker table tr td.active:active,
.datetimepicker table tr td.active:hover:active,
.datetimepicker table tr td.active.disabled:active,
.datetimepicker table tr td.active.disabled:hover:active,
.datetimepicker table tr td.active.active,
.datetimepicker table tr td.active:hover.active,
.datetimepicker table tr td.active.disabled.active,
.datetimepicker table tr td.active.disabled:hover.active,
.datetimepicker table tr td.active.disabled,
.datetimepicker table tr td.active:hover.disabled,
.datetimepicker table tr td.active.disabled.disabled,
.datetimepicker table tr td.active.disabled:hover.disabled,
.datetimepicker table tr td.active[disabled],
.datetimepicker table tr td.active:hover[disabled],
.datetimepicker table tr td.active.disabled[disabled],
.datetimepicker table tr td.active.disabled:hover[disabled] {
background-color: #0044cc;
}
.datetimepicker table tr td.active:active,
.datetimepicker table tr td.active:hover:active,
.datetimepicker table tr td.active.disabled:active,
.datetimepicker table tr td.active.disabled:hover:active,
.datetimepicker table tr td.active.active,
.datetimepicker table tr td.active:hover.active,
.datetimepicker table tr td.active.disabled.active,
.datetimepicker table tr td.active.disabled:hover.active {
background-color: #003399;
}
.datetimepicker table tr td span {
display: block;
width: 23%;
height: 54px;
line-height: 54px;
float: left;
margin: 1%;
cursor: pointer;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.datetimepicker .datetimepicker-hours span {
height: 26px;
line-height: 26px;
}
.datetimepicker .datetimepicker-hours table tr td span.hour_am,
.datetimepicker .datetimepicker-hours table tr td span.hour_pm {
width: 14.6%;
}
.datetimepicker .datetimepicker-hours fieldset legend,
.datetimepicker .datetimepicker-minutes fieldset legend {
margin-bottom: inherit;
line-height: 30px;
}
.datetimepicker .datetimepicker-minutes span {
height: 26px;
line-height: 26px;
}
.datetimepicker table tr td span:hover {
background: #eeeeee;
}
.datetimepicker table tr td span.disabled,
.datetimepicker table tr td span.disabled:hover {
background: none;
color: #999999;
cursor: default;
}
.datetimepicker table tr td span.active,
.datetimepicker table tr td span.active:hover,
.datetimepicker table tr td span.active.disabled,
.datetimepicker table tr td span.active.disabled:hover {
background-color: #006dcc;
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
background-image: linear-gradient(to bottom, #0088cc, #0044cc);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
border-color: #0044cc #0044cc #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
}
.datetimepicker table tr td span.active:hover,
.datetimepicker table tr td span.active:hover:hover,
.datetimepicker table tr td span.active.disabled:hover,
.datetimepicker table tr td span.active.disabled:hover:hover,
.datetimepicker table tr td span.active:active,
.datetimepicker table tr td span.active:hover:active,
.datetimepicker table tr td span.active.disabled:active,
.datetimepicker table tr td span.active.disabled:hover:active,
.datetimepicker table tr td span.active.active,
.datetimepicker table tr td span.active:hover.active,
.datetimepicker table tr td span.active.disabled.active,
.datetimepicker table tr td span.active.disabled:hover.active,
.datetimepicker table tr td span.active.disabled,
.datetimepicker table tr td span.active:hover.disabled,
.datetimepicker table tr td span.active.disabled.disabled,
.datetimepicker table tr td span.active.disabled:hover.disabled,
.datetimepicker table tr td span.active[disabled],
.datetimepicker table tr td span.active:hover[disabled],
.datetimepicker table tr td span.active.disabled[disabled],
.datetimepicker table tr td span.active.disabled:hover[disabled] {
background-color: #0044cc;
}
.datetimepicker table tr td span.active:active,
.datetimepicker table tr td span.active:hover:active,
.datetimepicker table tr td span.active.disabled:active,
.datetimepicker table tr td span.active.disabled:hover:active,
.datetimepicker table tr td span.active.active,
.datetimepicker table tr td span.active:hover.active,
.datetimepicker table tr td span.active.disabled.active,
.datetimepicker table tr td span.active.disabled:hover.active {
background-color: #003399;
}
.datetimepicker table tr td span.old {
color: #999999;
}
.datetimepicker th.switch {
width: 145px;
}
.datetimepicker th span.glyphicon {
pointer-events: none;
}
.datetimepicker thead tr:first-child th,
.datetimepicker tfoot th {
cursor: pointer;
}
.datetimepicker thead tr:first-child th:hover,
.datetimepicker tfoot th:hover {
background: #eeeeee;
}
.input-append.date .add-on i,
.input-prepend.date .add-on i,
.input-group.date .input-group-addon span {
cursor: pointer;
width: 14px;
height: 14px;
}
... ...
/*!
* Datetimepicker for Bootstrap
*
* Copyright 2012 Stefan Petre
* Improvements by Andrew Rowls
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
*/
.datetimepicker {
padding: 4px;
margin-top: 1px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
direction: ltr
}
.datetimepicker-inline {
width: 220px
}
.datetimepicker.datetimepicker-rtl {
direction: rtl
}
.datetimepicker.datetimepicker-rtl table tr td span {
float: right
}
.datetimepicker-dropdown, .datetimepicker-dropdown-left {
top: 0;
left: 0
}
[class*=" datetimepicker-dropdown"]:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute
}
[class*=" datetimepicker-dropdown"]:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
position: absolute
}
[class*=" datetimepicker-dropdown-top"]:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 7px solid #ccc;
border-top-color: rgba(0, 0, 0, 0.2);
border-bottom: 0
}
[class*=" datetimepicker-dropdown-top"]:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #fff;
border-bottom: 0
}
.datetimepicker-dropdown-bottom-left:before {
top: -7px;
right: 6px
}
.datetimepicker-dropdown-bottom-left:after {
top: -6px;
right: 7px
}
.datetimepicker-dropdown-bottom-right:before {
top: -7px;
left: 6px
}
.datetimepicker-dropdown-bottom-right:after {
top: -6px;
left: 7px
}
.datetimepicker-dropdown-top-left:before {
bottom: -7px;
right: 6px
}
.datetimepicker-dropdown-top-left:after {
bottom: -6px;
right: 7px
}
.datetimepicker-dropdown-top-right:before {
bottom: -7px;
left: 6px
}
.datetimepicker-dropdown-top-right:after {
bottom: -6px;
left: 7px
}
.datetimepicker > div {
display: none
}
.datetimepicker.minutes div.datetimepicker-minutes {
display: block
}
.datetimepicker.hours div.datetimepicker-hours {
display: block
}
.datetimepicker.days div.datetimepicker-days {
display: block
}
.datetimepicker.months div.datetimepicker-months {
display: block
}
.datetimepicker.years div.datetimepicker-years {
display: block
}
.datetimepicker table {
margin: 0
}
.datetimepicker td, .datetimepicker th {
text-align: center;
width: 20px;
height: 20px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: 0
}
.table-striped .datetimepicker table tr td, .table-striped .datetimepicker table tr th {
background-color: transparent
}
.datetimepicker table tr td.minute:hover {
background: #eee;
cursor: pointer
}
.datetimepicker table tr td.hour:hover {
background: #eee;
cursor: pointer
}
.datetimepicker table tr td.day:hover {
background: #eee;
cursor: pointer
}
.datetimepicker table tr td.old, .datetimepicker table tr td.new {
color: #999
}
.datetimepicker table tr td.disabled, .datetimepicker table tr td.disabled:hover {
background: 0;
color: #999;
cursor: default
}
.datetimepicker table tr td.today, .datetimepicker table tr td.today:hover, .datetimepicker table tr td.today.disabled, .datetimepicker table tr td.today.disabled:hover {
background-color: #fde19a;
background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
background-image: linear-gradient(to bottom, #fdd49a, #fdf59a);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
border-color: #fdf59a #fdf59a #fbed50;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false)
}
.datetimepicker table tr td.today:hover, .datetimepicker table tr td.today:hover:hover, .datetimepicker table tr td.today.disabled:hover, .datetimepicker table tr td.today.disabled:hover:hover, .datetimepicker table tr td.today:active, .datetimepicker table tr td.today:hover:active, .datetimepicker table tr td.today.disabled:active, .datetimepicker table tr td.today.disabled:hover:active, .datetimepicker table tr td.today.active, .datetimepicker table tr td.today:hover.active, .datetimepicker table tr td.today.disabled.active, .datetimepicker table tr td.today.disabled:hover.active, .datetimepicker table tr td.today.disabled, .datetimepicker table tr td.today:hover.disabled, .datetimepicker table tr td.today.disabled.disabled, .datetimepicker table tr td.today.disabled:hover.disabled, .datetimepicker table tr td.today[disabled], .datetimepicker table tr td.today:hover[disabled], .datetimepicker table tr td.today.disabled[disabled], .datetimepicker table tr td.today.disabled:hover[disabled] {
background-color: #fdf59a
}
.datetimepicker table tr td.today:active, .datetimepicker table tr td.today:hover:active, .datetimepicker table tr td.today.disabled:active, .datetimepicker table tr td.today.disabled:hover:active, .datetimepicker table tr td.today.active, .datetimepicker table tr td.today:hover.active, .datetimepicker table tr td.today.disabled.active, .datetimepicker table tr td.today.disabled:hover.active {
background-color: #fbf069
}
.datetimepicker table tr td.active, .datetimepicker table tr td.active:hover, .datetimepicker table tr td.active.disabled, .datetimepicker table tr td.active.disabled:hover {
background-color: #006dcc;
background-image: -moz-linear-gradient(top, #08c, #04c);
background-image: -ms-linear-gradient(top, #08c, #04c);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));
background-image: -webkit-linear-gradient(top, #08c, #04c);
background-image: -o-linear-gradient(top, #08c, #04c);
background-image: linear-gradient(to bottom, #08c, #04c);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
border-color: #04c #04c #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25)
}
.datetimepicker table tr td.active:hover, .datetimepicker table tr td.active:hover:hover, .datetimepicker table tr td.active.disabled:hover, .datetimepicker table tr td.active.disabled:hover:hover, .datetimepicker table tr td.active:active, .datetimepicker table tr td.active:hover:active, .datetimepicker table tr td.active.disabled:active, .datetimepicker table tr td.active.disabled:hover:active, .datetimepicker table tr td.active.active, .datetimepicker table tr td.active:hover.active, .datetimepicker table tr td.active.disabled.active, .datetimepicker table tr td.active.disabled:hover.active, .datetimepicker table tr td.active.disabled, .datetimepicker table tr td.active:hover.disabled, .datetimepicker table tr td.active.disabled.disabled, .datetimepicker table tr td.active.disabled:hover.disabled, .datetimepicker table tr td.active[disabled], .datetimepicker table tr td.active:hover[disabled], .datetimepicker table tr td.active.disabled[disabled], .datetimepicker table tr td.active.disabled:hover[disabled] {
background-color: #04c
}
.datetimepicker table tr td.active:active, .datetimepicker table tr td.active:hover:active, .datetimepicker table tr td.active.disabled:active, .datetimepicker table tr td.active.disabled:hover:active, .datetimepicker table tr td.active.active, .datetimepicker table tr td.active:hover.active, .datetimepicker table tr td.active.disabled.active, .datetimepicker table tr td.active.disabled:hover.active {
background-color: #039
}
.datetimepicker table tr td span {
display: block;
width: 23%;
height: 54px;
line-height: 54px;
float: left;
margin: 1%;
cursor: pointer;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px
}
.datetimepicker .datetimepicker-hours span {
height: 26px;
line-height: 26px
}
.datetimepicker .datetimepicker-hours table tr td span.hour_am, .datetimepicker .datetimepicker-hours table tr td span.hour_pm {
width: 14.6%
}
.datetimepicker .datetimepicker-hours fieldset legend, .datetimepicker .datetimepicker-minutes fieldset legend {
margin-bottom: inherit;
line-height: 30px
}
.datetimepicker .datetimepicker-minutes span {
height: 26px;
line-height: 26px
}
.datetimepicker table tr td span:hover {
background: #eee
}
.datetimepicker table tr td span.disabled, .datetimepicker table tr td span.disabled:hover {
background: 0;
color: #999;
cursor: default
}
.datetimepicker table tr td span.active, .datetimepicker table tr td span.active:hover, .datetimepicker table tr td span.active.disabled, .datetimepicker table tr td span.active.disabled:hover {
background-color: #006dcc;
background-image: -moz-linear-gradient(top, #08c, #04c);
background-image: -ms-linear-gradient(top, #08c, #04c);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#08c), to(#04c));
background-image: -webkit-linear-gradient(top, #08c, #04c);
background-image: -o-linear-gradient(top, #08c, #04c);
background-image: linear-gradient(to bottom, #08c, #04c);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
border-color: #04c #04c #002a80;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25)
}
.datetimepicker table tr td span.active:hover, .datetimepicker table tr td span.active:hover:hover, .datetimepicker table tr td span.active.disabled:hover, .datetimepicker table tr td span.active.disabled:hover:hover, .datetimepicker table tr td span.active:active, .datetimepicker table tr td span.active:hover:active, .datetimepicker table tr td span.active.disabled:active, .datetimepicker table tr td span.active.disabled:hover:active, .datetimepicker table tr td span.active.active, .datetimepicker table tr td span.active:hover.active, .datetimepicker table tr td span.active.disabled.active, .datetimepicker table tr td span.active.disabled:hover.active, .datetimepicker table tr td span.active.disabled, .datetimepicker table tr td span.active:hover.disabled, .datetimepicker table tr td span.active.disabled.disabled, .datetimepicker table tr td span.active.disabled:hover.disabled, .datetimepicker table tr td span.active[disabled], .datetimepicker table tr td span.active:hover[disabled], .datetimepicker table tr td span.active.disabled[disabled], .datetimepicker table tr td span.active.disabled:hover[disabled] {
background-color: #04c
}
.datetimepicker table tr td span.active:active, .datetimepicker table tr td span.active:hover:active, .datetimepicker table tr td span.active.disabled:active, .datetimepicker table tr td span.active.disabled:hover:active, .datetimepicker table tr td span.active.active, .datetimepicker table tr td span.active:hover.active, .datetimepicker table tr td span.active.disabled.active, .datetimepicker table tr td span.active.disabled:hover.active {
background-color: #039
}
.datetimepicker table tr td span.old {
color: #999
}
.datetimepicker th.switch {
width: 145px
}
.datetimepicker th span.glyphicon {
pointer-events: none
}
.datetimepicker thead tr:first-child th, .datetimepicker tfoot th {
cursor: pointer
}
.datetimepicker thead tr:first-child th:hover, .datetimepicker tfoot th:hover {
background: #eee
}
.input-append.date .add-on i, .input-prepend.date .add-on i, .input-group.date .input-group-addon span {
cursor: pointer;
width: 14px;
height: 14px
}
\ No newline at end of file
... ...