Created
February 27, 2017 12:07
-
-
Save shingorow/e2e5f92a5916f1ec998ce4a199e7d256 to your computer and use it in GitHub Desktop.
Revisions
-
shingorow created this gist
Feb 27, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ (function(global) { function SetValueToToday(className) { var date = new Date(), year, month, day, today; this.className = className || 'set-value-to-today'; this.className = this.className.replace(/^\./, ''); year = date.getFullYear(); month = date.getMonth() + 1; day = date.getDate(); today = year + '/' + month + '/' + day; $('.' + this.className).val(today); } global.SetValueToToday = SetValueToToday; }(this));