#122 store utc time in the databse + obtain timezone offset of the client upon login + offset times returned to client based on session offset

This commit is contained in:
Drewster727 2016-03-31 22:23:38 -05:00
commit 3dbef199aa
11 changed files with 61 additions and 11 deletions

View file

@ -6,6 +6,7 @@
Remember Me <input name="RememberMe" type="checkbox" value="True"/>
<br/><br/>
<input class="btn btn-success-outline" type="submit" value="Login"/>
<input type="hidden" id="DateTimeOffset" name="DateTimeOffset" />
</form>
@if (!Model.AdminExists)
{
@ -19,3 +20,9 @@
</div>
}
<script>
$(function () {
var dtOffset = new Date().getTimezoneOffset();
$('#DateTimeOffset').val(dtOffset);
});
</script>

View file

@ -1,7 +1,7 @@
<form method="POST">
Username <input class="form-control" type="text" name="Username" />
Username <input class="form-control form-control-custom" type="text" name="Username" />
<br />
Password <input class="form-control" name="Password" type="password" />
Password <input class="form-control form-control-custom" name="Password" type="password" />
<br />
<br />
<input class="btn btn-success-outline" type="submit" value="Create User" />

View file

@ -38,10 +38,14 @@
$('#loginBtn').click(function (e) {
e.preventDefault();
var $form = $("#loginForm");
var formData = $form.serialize();
var dtOffset = new Date().getTimezoneOffset();
formData += ('&DateTimeOffset=' + dtOffset)
$.ajax({
type: $form.prop("method"),
url: $form.prop("action"),
data: $form.serialize(),
data: formData,
dataType: "json",
success: function (response) {
console.log(response);