1. ditto
  2. foodcapsule

Commits

ditto  committed 7aad28e

* 바 너비 수정
* 가장 가까운 시각 선택

  • Participants
  • Parent commits 88f3d44
  • Branches default

Comments (0)

Files changed (2)

File foodcapsule/static/style.css

View file
 #geolocation a { font-weight: bold; }
 #geolocation .button { display: inline-block; border-radius: 20px; }
 #id_location { width: 75%; }
-#metadata-bar { margin: 0 auto; padding: 0; list-style: none; overflow: hidden; width: 363px; }
+#metadata-bar { margin: 0 auto; padding: 0; list-style: none; overflow: hidden; width: 303px; }
 #metadata-bar input { display: none; }
 #metadata-bar li {
     background: #f8f8f8 url(button-bg.gif) repeat-x bottom;
     overflow: hidden;
-    width: 120px;
+    width: 100px;
     border: 1px solid #ddd;
     border-top: 0; border-left: 0;
     float: left;

File foodcapsule/templates/new_post.html

View file
     var time = new Date(0, 0, 0, 0, 0, 0);
     var endTime = new Date(0, 0, 0, 23, 30, 0);
     var step = 30;
+    var now = new Date();
+    var nearestMin = Math.floor(now.getMinutes() / step) * step;
     while (time <= endTime) {
         var h = time.getHours();
         var hours = ((h + 11) % 12) + 1;
         var m = time.getMinutes();
+        var sel = h == now.getHours() && m == nearestMin;
         var str = (h < 12 ? '오전' : '오후') + ' ' + hours + '시' + (m == 30 ? ' 반' : '');
-        $('#time-picker').append('<option value="' + h + ':' + m + '">' + str + '</option>');
+        $('#time-picker').append('<option value="' + h + ':' + m + '"' + (sel ? ' selected' : '') + '>' + str + '</option>');
         time = new Date(time.setMinutes(time.getMinutes() + step));
     }