forked from theproductguy/CuteTime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cutetime.fr.demo.html
169 lines (150 loc) · 6.03 KB
/
cutetime.fr.demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<html>
<head>
<title>CuteTime Plugin Demo (French)</title>
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
<script src="js/jquery.cuteTime.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
//////////// FRENCH ///////////////////
var french = {
time_ranges: [
{bound: Number.NEGATIVE_INFINITY,
cuteness: 'le futur!', unit_size: 0},
{bound: 0,
cuteness: 'maintenant', unit_size: 0},
{bound: 20 * 1000,
cuteness: 'il y a quelques secondes', unit_size: 0},
{bound: 60 * 1000,
cuteness: 'il y a une minute', unit_size: 0},
{bound: 60 * 1000 * 2,
cuteness: 'il y a %CT% minutes', unit_size: 60 * 1000},
{bound: 60 * 1000 * 60,
cuteness: 'il y a une heure', unit_size: 0},
{bound: 60 * 1000 * 60 * 2,
cuteness: 'il y a %CT% heures', unit_size: 60 * 1000 * 60},
{bound: 60 * 1000 * 60 * 24,
cuteness: 'hier', unit_size: 0},
{bound: 60 * 1000 * 60 * 24 * 2,
cuteness: 'il y a %CT% jours', unit_size: 60 * 1000 * 60 * 24},
{bound: 60 * 1000 * 60 * 24 * 30,
cuteness: 'le mois dernier', unit_size: 0},
{bound: 60 * 1000 * 60 * 24 * 30 * 2,
cuteness: 'il y a %CT% mois', unit_size: 60 * 1000 * 60 * 24 * 30},
{bound: 60 * 1000 * 60 * 24 * 30 * 12,
cuteness: 'l\'année dernière', unit_size: 0},
{bound: 60 * 1000 * 60 * 24 * 30 * 12 * 2,
cuteness: 'il y a %CT% ans', unit_size: 60 * 1000 * 60 * 24 * 30 * 12},
{bound: Number.POSITIVE_INFINITY,
cuteness: 'il y a très longtemps', unit_size: 0}
]
};
$('.timestamp2').cuteTime(french);
// returns a cuter string of the passed in datetime
$('.predetermined2').html(" -> "+$.cuteTime(french,'2009/10/16 22:11:19'));
$('.predetermined11').html(" -> "+$.cuteTime(french,'2009'));
$('.predetermined12').html(" -> "+$.cuteTime(french,'2009-11'));
$('.predetermined13').html(" -> "+$.cuteTime(french,'2009-11-16'));
$('.predetermined14').html(" -> "+$.cuteTime(french,'2009-11-24T19:20+01:00'));
$('.predetermined15').html(" -> "+$.cuteTime(french,'2009-11-24T19:20:30+01:00'));
$('.predetermined151').html(" -> "+$.cuteTime(french,'2009-11-249T19:20:30+01:00'));
$('.predetermined16').html(" -> "+$.cuteTime(french,'2009-11-24T19:20:30.45+01:00'));
$('.predetermined17').html(" === "+$.cuteTime(french,'2009-11-24T08:15:30-05:00'));
$('.predetermined18').html(" === "+$.cuteTime(french,'2009-11-24T13:15:30Z'));
var french_refresh = {
time_ranges: [
{bound: Number.NEGATIVE_INFINITY,
cuteness: 'le futur!', unit_size: 0},
{bound: 0,
cuteness: 'maintenant', unit_size: 0},
{bound: 20 * 1000,
cuteness: 'il y a quelques secondes', unit_size: 0},
{bound: 60 * 1000,
cuteness: 'il y a une minute', unit_size: 0},
{bound: 60 * 1000 * 2,
cuteness: 'il y a %CT% minutes', unit_size: 60 * 1000},
{bound: 60 * 1000 * 60,
cuteness: 'il y a une heure', unit_size: 0},
{bound: 60 * 1000 * 60 * 2,
cuteness: 'il y a %CT% heures', unit_size: 60 * 1000 * 60},
{bound: 60 * 1000 * 60 * 24,
cuteness: 'hier', unit_size: 0},
{bound: 60 * 1000 * 60 * 24 * 2,
cuteness: 'il y a %CT% jours', unit_size: 60 * 1000 * 60 * 24},
{bound: 60 * 1000 * 60 * 24 * 30,
cuteness: 'le mois dernier', unit_size: 0},
{bound: 60 * 1000 * 60 * 24 * 30 * 2,
cuteness: 'il y a %CT% mois', unit_size: 60 * 1000 * 60 * 24 * 30},
{bound: 60 * 1000 * 60 * 24 * 30 * 12,
cuteness: 'l\'année dernière', unit_size: 0},
{bound: 60 * 1000 * 60 * 24 * 30 * 12 * 2,
cuteness: 'il y a %CT% ans', unit_size: 60 * 1000 * 60 * 24 * 30 * 12},
{bound: Number.POSITIVE_INFINITY,
cuteness: 'il y a très longtemps', unit_size: 0}
],
refresh: 10000
};
my_cutetime2 = $('.timestamp_move2').cuteTime(french_refresh);
});
</script>
</head>
<body>
<a href="http://tpgblog.com/cutetime" target="_top">return to CuteTime HomePage >>></a>
<br><br>
<div class="timestamp2">
2009/10/12 22:11:19
</div>
<div class="timestamp2">
2008/11/01 07:11:00
</div>
<div class="timestamp2">
2018/11/01 07:11:00
</div>
<div class="timestamp2"></div>
<div class="timestamp2" data-timestamp="1980/10/12 22:11:19">
2009/10/12 22:11:19
</div>
<div class="timestamp2" data-timestamp="asd">
10/12/2009 22:11:19
</div>
<div class="timestamp2" data-timestamp="asd">
aoisd
</div>
<div class="timestamp2" data-timestamp="asd"></div>
<div class='predetermined2'></div>
<!------------------------------------------------------------------------------->
<div>
<a href="#" onClick="$(my_cutetime2).cuteTime.start_cuteness();">start</a> |
<a href="#" onClick="$(my_cutetime2).cuteTime.stop_cuteness();">stop</a> |
<a href="#" onClick="$(my_cutetime2).cuteTime.update_cuteness();">update</a>
</div>
<div class="timestamp_move2">
2009/10/12 22:11:19
</div>
<div class="timestamp_move2">
2008/11/01 07:11:00
</div>
<div class="timestamp_move2">
2018/11/01 07:11:00
</div>
<div class="timestamp_move2"></div>
<div class="timestamp_move2" data-timestamp="1980 10 12 22:11:19">
2009/10/12 22:11:19
</div>
<div class="timestamp_move2" data-timestamp="asd">
2009/10/12 22:11:19
</div>
<div class="timestamp_move2" data-timestamp="asd">
aoisd
</div>
<div class="timestamp_move2" data-timestamp="asd"></div>
<div class='predetermined11'></div>
<div class='predetermined12'></div>
<div class='predetermined13'></div>
<div class='predetermined14'></div>
<div class='predetermined15'></div>
<div class='predetermined151'></div>
<div class='predetermined16'></div>
<div class='predetermined17'></div>
<div class='predetermined18'></div>
</body>
</html>