반응형

http://stackoverflow.com/questions/11887934/check-if-daylight-saving-time-is-in-effect-and-if-it-is-for-how-many-hours

 

How to check if the DST (Daylight Saving Time) is in effect and if it is what's the offset?

This is a bit of my JS code for which this is needed: var secDiff = Math.abs(Math.round((utc_date-this.premiere_date)/1000)); this.years = this.calculateUnit(secDiff,(86400*365)); this.days = this.

stackoverflow.com

ex)

 

javascript :

 

  jQuery("[data-utc-date]").each(function(){
   var utc_date_string = jQuery(this).data("utc-date");
   var localdate = new Date(utc_date_string);
//console.log(utc_date_string);
//console.log(">> "+ localdate.toString());
//console.log(">> "+ date("Y-m-d", localdate.getTime()/1000));
jQuery(this).text(date("Y-m-d", localdate.getTime()/1000));
});

  jQuery("[data-utc-date-time]").each(function(){
   var utc_date_string = jQuery(this).data("utc-date-time");
   var localdate = new Date(utc_date_string);
//console.log(utc_date_string);
//console.log(">> "+ localdate.toString());
//console.log(">> "+ date("Y-m-d", localdate.getTime()/1000));
jQuery(this).text(date("Y-m-d H:i:s", localdate.getTime()/1000));

});

 

+

http://phpjs.org/functions/date/

불러오는 중입니다...

 

반응형

'WEB > HTML&SCRIPTS' 카테고리의 다른 글

jQuery UploadFile plugin  (0) 2019.07.15
js MarkDown helper library  (0) 2019.07.15
JQuery - 스마트폰 감지  (0) 2019.07.15
jQuery.ajax xdom cors 응답 문제 시  (0) 2019.07.15
CSS 핵 정리 (IE6, IE7, IE8, IE9), FF, Chrome, Safari  (0) 2011.10.03
반응형

http://jewonagency.com/%ec%8a%a4%eb%a7%88%ed%8a%b8%ed%8f%b0-%ea%b0%90%ec%a7%80%ed%95%98%eb%8a%94-jquery-%ec%bd%94%eb%93%9c/

 

스마트폰 감지하는 jQuery 코드 - 재원에이전시 | 반응형

정확히 말하면, 터치가 가능한 디바이스를 찾는 코드입니다만.. 웹사이트를 만들다 보면, 미디어 쿼리로 만으로 해결되지 않는 부분이 있습니다. 즉, 고해상도 스마트폰의 경우이죠~ 예를 들어, 우드매니아 고객님의 …

jewonagency.com

jQuery(document).ready(function($) { var isTouchDevice = 'ontouchstart' in window || navigator.msMaxTouchPoints; if (isTouchDevice) { $('.mobileonly').show(); } });

반응형
반응형

var strToMatch = "<img src=\"http://a.jpg\"/> image1<img src='http://b.jpg'/> image2  <img src='http://a.gif'/>";
var strReg = new RegExp("http://*[^>]*\\.(jpg|gif|png)","gim");
var xArr =  strToMatch.match(strReg);

반응형
반응형

function trim(string) {
  return string.replace(/(^\s*)|(\s*$)/g, "");
}  

반응형
반응형

<html>
<head><title>주민등록번호 검사</title>
<script language="javascript">
function chkresno(resno) {

  // 주민번호의 형태와 7번째 자리(성별) 유효성 검사
  fmt = /^\d{6}-[1234]\d{6}$/;
  if (!fmt.test(resno)) {
    alert("잘못된 주민등록번호입니다."); return;
  }

  // 날짜 유효성 검사
  birthYear = (resno.charAt(7) <= "2") ? "19" : "20";
  birthYear += resno.substr(0, 2);
  birthMonth = resno.substr(2, 2) - 1;
  birthDate = resno.substr(4, 2);
  birth = new Date(birthYear, birthMonth, birthDate);

  if ( birth.getYear() % 100 != resno.substr(0, 2) ||
       birth.getMonth() != birthMonth ||
       birth.getDate() != birthDate) {
    alert("잘못된 주민등록번호입니다."); return;
  }

  // Check Sum 코드의 유효성 검사
  buf = new Array(13);
  for (i = 0; i < 6; i++) buf[i] = parseInt(resno.charAt(i));
  for (i = 6; i < 13; i++) buf[i] = parseInt(resno.charAt(i + 1));

  multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
  for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]);

  if ((11 - (sum % 11)) % 10 != buf[12]) {
    alert("잘못된 주민등록번호입니다."); return;
  }

  alert("정상적인 주민등록번호입니다.");
}
</script>
</head>
<body>
<h1>주민등록번호 검사</h1>
<form onSubmit="chkresno(this.resno.value);">
주민등록번호 <input type="text" name="resno">
<input type="submit" value="지금 검사">
</form>
</body>
반응형
반응형
반응형
반응형
반응형
반응형

CKEDITOR 이미지 섹션에 이미지 업로드된 서버보기가 존재하는데
그 것을 없애게 (여러명이 공유해서 사용하는 경우)하는 방법

1. 시술전

2. 시술과정
 ~/ckeditor/plugins/image/dialogs/image.js 로 이동하여 다음글귀를 변경

--------------------------------------------------------------------------------     type:'button',id:'browse',style:'display:inline-block;margin-top:10px;'    
-> type:'button',id:'browse',style:'display:none;/*inline-block;*/margin-top:10px;'
--------------------------------------------------------------------------------

 

3. 시술후

짜잔~


반응형

+ Recent posts