果然不及时整理,知识就会变得生疏。时间比较长了,可能花费的时间也多些吧
这周主要学习内容有git 和 js
一、 GIT
1、 git的基本工作命令
- git clone
- git add
- git commit -m 'yyy'
- git pull
- git push original master 第一次提交
- git checkout -- 某个dir 或者某个file
- git stage
- 编写.gitignore 文件 ,该文件可以不跟踪未被缓存下来的项目文件
-
git config --global user.name "shaoman.lhj"
-
git branch '分支名' ,自己创建一个分支时,第一次提交的格式 git push original 分支名
-
git checkout 分支名
-
git branch -D 分知名 删除一个分支
-
git push origin --delete <branchName> 删除一个远程分支
2、 git pull request 是很好的code reviewer 工具,你pull request之后会向对应的人发送消息
二、 JS
1、 日期获取
获取一个月的日期天数,可以使用 getDate , getDay 是获取一周内的第几天
var today = new Date() ; 如果往前推算5天,则可以使用 today.setDate(today.getDate() + 5) ; // 和 java中有点不同 往后负数即可 同样,增加年或者月,可以使用 d.setMonth(d.getMonth()+5); // d.setFullYear(d.getFullYear()+5);
js getUTCMonth vs getMonth
The UTC methods calculate their date assuming that the date object is of local time and date.
|
if(isZeptoOK()){ homeinit(); } else{ timer = setInterval(function (){ if(isZeptoOK()){ clearInterval(timer); homeinit(); } } ,30); } |
the The |
目的是为了防止,之前没有定义onload 事件,会出现js错误~ ~
|
if(typeof todayTime === 'string'){ |
{ "itemList": [ { "itemId": "1999", "mainPicUrl": "../assets/imgs/zhu.jpg", "sideUpUrl": "../assets/imgs/tuanzi.png", "sideDownUrl": "../assets/imgs/sakura.jpg", "itemName": "团子大家族团子", "time": "1999999" }, { "itemId": "1999", "mainPicUrl": "../assets/imgs/sabereye.jpg", "sideUpUrl": "../assets/imgs/saberjian.png", "sideDownUrl": "../assets/imgs/sabermotuo.jpg", "itemName": "誓约胜利之剑", "time": "1999999" } ] } |
then you can wrap it in the jquery function |
如果在jquery中 $ 表示jquery, zepto中 表示zepto |
#paimaidate li{ display: inline; font-family:"Arial Narrow"; font-size: 20px; padding-right: 140px; line-height: 40px; } .homedate:hover{ // 修改成 #paimaidate .homedate:hover 即可 font-weight: bold ; font-size: 28px ; color: #36C075; } |