JavaScriptã®Dateãªãã¸ã§ã¯ãã¯date.setMonth(-1)ã¨ããã¨ãåå¹´ã®12æã«ãã¦ããã¦å¤§å¤ä¾¿å©ãªã®ã§ãããSafariã§ä¸æãåããªãã£ãããããããªã®ã§prototypeä¸æ¸ãã§å¯¾å¦ãã¦ã¿ã¾ããã // fix safari's Date#setMonth (function(){ var set_month = Date.prototype.setMonth; Date.prototype.setMonth = function(num){ if(num <= -1){ var n = Math.ceil(-num); var back_year = Math.ceil(n/12); var month = (n % 12) ? 12 - n % 12 : 0 ; this.setFullYear(this.getFullYear() - back_year)
{{#tags}}- {{label}}
{{/tags}}