diff options
author | Aaron Parecki <aaron@parecki.com> | 2023-10-08 21:05:18 +0000 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2023-10-08 21:05:18 +0000 |
commit | 01f99ab9407ad1e4235b90344181ae4ba96bd9dc (patch) | |
tree | 9d7fd2af40cbbfc0f46c3d4279c05fb64199f169 /views/new-weight.php | |
parent | 17c5d57fd05cb4ee5b0b189bd4cbf519fb636d41 (diff) |
add published date to weight page
Diffstat (limited to 'views/new-weight.php')
-rw-r--r-- | views/new-weight.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/views/new-weight.php b/views/new-weight.php index 36e68ae..121b368 100644 --- a/views/new-weight.php +++ b/views/new-weight.php @@ -13,6 +13,11 @@ <input type="number" id="weight_num" class="form-control"> </div> + <div class="form-group"> + <label for="date">Date and Time</label> + <input type="text" id="date" class="form-control" value="<?= date('Y-m-d H:i:s') ?>"> + </div> + <div style="float: right; margin-top: 6px;"> <button class="btn btn-success" id="btn_post">Post</button> </div> @@ -23,11 +28,17 @@ </div> <script> $(function(){ + + var d = new Date(); + var tzOffset = tz_seconds_to_offset(d.getTimezoneOffset() * 60 * -1); + $("#date").val( $("#date").val() + " " + tzOffset); + $("#btn_post").click(function(){ $("#btn_post").addClass("loading disabled"); $.post("/weight", { - weight_num: $("#weight_num").val() + weight_num: $("#weight_num").val(), + published: $("#date").val() }, function(response){ if(response.location != false) { |