Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
guru
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
guru
Commits
2e6331da
Commit
2e6331da
authored
Dec 24, 2018
by
Clint.Network
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement MomentJS
parent
5820508c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
LotteryService.cs
Stratis.Guru/Services/LotteryService.cs
+4
-2
Lottery.cshtml
Stratis.Guru/Views/Home/Lottery.cshtml
+5
-3
No files found.
Stratis.Guru/Services/LotteryService.cs
View file @
2e6331da
...
...
@@ -32,6 +32,7 @@ namespace Stratis.Guru.Services
public
async
Task
StartAsync
(
CancellationToken
cancellationToken
)
{
Console
.
WriteLine
(
TimeZone
.
CurrentTimeZone
.
StandardName
.
ToString
());
JackpotCounter
();
await
InitLotteryAsync
();
await
CalculateNextDrawAsync
();
...
...
@@ -60,11 +61,12 @@ namespace Stratis.Guru.Services
private
async
Task
CalculateNextDrawAsync
()
{
DateTime
today
=
DateTime
.
Today
;
DateTime
today
=
DateTime
.
UtcNow
;
int
daysUntilFriday
=
((
int
)
DayOfWeek
.
Friday
-
(
int
)
today
.
DayOfWeek
+
7
)
%
7
;
_nextDraw
=
today
.
AddDays
(
daysUntilFriday
);
_nextDraw
=
DateTime
.
UtcNow
;
var
nextDrawTimestamp
=
((
DateTimeOffset
)
_nextDraw
).
ToUnixTimeSeconds
();
//TODO: set to 8pm
await
_draws
.
InitDrawAsync
(
nextDrawTimestamp
);
...
...
Stratis.Guru/Views/Home/Lottery.cshtml
View file @
2e6331da
...
...
@@ -139,8 +139,8 @@
<recaptcha-script/>
<script src="~/lib/jquery-countdown/dist/jquery.countdown.min.js"></script>
<script src="~/lib/jquery-ajax-unobtrusive/dist/jquery.unobtrusive-ajax.min.js"></script>
<script src="
~/lib/moment/min/moment
.min.js"></script>
<script src="
~/lib/moment/min/moment-with-locales
.min.js"></script>
<script src="
//cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.3/moment-with-locales
.min.js"></script>
<script src="
//cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.4.0/moment-timezone-with-data-2010-2020
.min.js"></script>
<script type="text/javascript">
function PaymentSuccess()
{
...
...
@@ -163,9 +163,11 @@
<text>$("#deposit-modal").modal({backdrop: 'static', keyboard: false});</text>
}
$('#clock').countdown('@((DateTimeOffset.FromUnixTimeSeconds((long)ViewBag.NextDraw)).ToString("yyyy/MM/dd HH:mm:ss"))', function(event) {
var nextYear = moment.tz("@((DateTimeOffset.FromUnixTimeSeconds((long)ViewBag.NextDraw)).ToString("yyyy-MM-dd 20:00"))", "Europe/London");
$('#clock').countdown(nextYear.toDate(), function(event) {
$(this).html(event.strftime('%D days %Hh %Mm %Ss'));
});
@*'@((DateTimeOffset.FromUnixTimeSeconds((long)ViewBag.NextDraw)).ToString("yyyy/MM/dd HH:mm:ss"))'*@
})
</script>
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment