Skip to content

Commit

Permalink
dosyalar güncel zaman bilgisi ile isimlendirilecek şekilde ayarlandı
Browse files Browse the repository at this point in the history
  • Loading branch information
aylincsknpnr committed Feb 25, 2015
1 parent b3ec4f6 commit df277db
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
15 changes: 14 additions & 1 deletion tripwire/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function listContents(storagename) {
var file = new Blob([$(this).val()], {type: "text/plain"});


var request = sdcard.addNamed(file, "yeni4.txt");
var request = sdcard.addNamed(file, d.yyyymmdd()+".txt");

request.onsuccess = function () {
var name = this.result;
Expand All @@ -55,3 +55,16 @@ $(document).ready(function(){
listContents("sdcard");

});
Date.prototype.yyyymmdd = function() {
var yyyy = this.getFullYear().toString();
var mm = (this.getMonth()+1).toString(); // getMonth() is zero-based
var dd = this.getDate().toString();
var h = this.getHours().toString();
var m = this.getMinutes().toString();
var s = this.getSeconds().toString();

return yyyy + "." + (mm[1]?mm:"0"+mm[0]) + "." + (dd[1]?dd:"0"+dd[0]) + "-" + (h[1]?h:"0"+h[0]) +"." + (m[1]?m:"0"+m[0]) +"." + (s[1]?s:"0"+s[0]); // padding
};

d = new Date();
alert( d.yyyymmdd() );
11 changes: 10 additions & 1 deletion tripwire/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,17 @@ <h3>Tripwire</h3>

<div data-role="content">

<div id="results"></div>
<div id="results">

</div>

</div><!-- /content -->
<div style="text-align: center;"><span style="color: rgb(0, 0, 0);">

<div id="clock" style="text-align: center;">&nbsp;</div>




</div><!-- /page home -->

Expand Down

0 comments on commit df277db

Please sign in to comment.