[Javascript] settare data

  • Creatore Discussione Creatore Discussione alexad
  • Data di inizio Data di inizio

alexad

Nuovo Utente
3 Nov 2017
3
0
1
36
Ciao a tutti.
Avrei bisogno di modificare il seguente codice, che rileva la data dal s.o., ed impostarne una scelta da me, ad esempio oggi 03/11/2017.
Qualcuno può aiutarmi su cosa modificare/cancellare?
Grazie!!!
* * *

.class public Lcom/B/U/CalcoloDate;
.super Ljava/lang/Object;
.source "CalcoloDate.java"


# instance fields
.field glo:Lcom/B/U/K;


# direct methods
.method public constructor <init>()V
.locals 1

.prologue
.line 10
invoke-direct {p0}, Ljava/lang/Object;-><init>()V

.line 12
new-instance v0, Lcom/B/U/K;

invoke-direct {v0}, Lcom/B/U/K;-><init>()V

iput-object v0, p0, Lcom/B/U/CalcoloDate;->glo:Lcom/B/U/K;

return-void
.end method


# virtual methods
.method public DataMaggioreUgualeOggi(Ljava/lang/String;)Z
.locals 12
.param p1, "DataFinale" # Ljava/lang/String;

.prologue
const/4 v9, 0x0

const/4 v8, 0x1

.line 17
const-string v10, ""

invoke-virtual {p1, v10}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v10

if-eqz v10, :cond_1

.line 57
:cond_0
:goto_0
return v8

.line 20
:cond_1
if-eqz p1, :cond_0

.line 26
new-instance v3, Ljava/util/GregorianCalendar;

invoke-direct {v3}, Ljava/util/GregorianCalendar;-><init>()V

.line 27
.local v3, "cal":Ljava/util/GregorianCalendar;
const/4 v10, 0x5

invoke-virtual {v3, v10}, Ljava/util/GregorianCalendar;->get(I)I

move-result v4

.line 28
.local v4, "day":I
const/4 v10, 0x2

invoke-virtual {v3, v10}, Ljava/util/GregorianCalendar;->get(I)I

move-result v10

add-int/lit8 v6, v10, 0x1

.line 29
.local v6, "month":I
invoke-virtual {v3, v8}, Ljava/util/GregorianCalendar;->get(I)I

move-result v7

.line 31
.local v7, "year":I
new-instance v10, Ljava/lang/StringBuilder;

invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V

invoke-virtual {v10, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

move-result-object v10

const-string v11, "/"

invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v10

invoke-virtual {v10, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

move-result-object v10

const-string v11, "/"

invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

move-result-object v10

invoke-virtual {v10, v7}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

move-result-object v10

invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v1

.line 36
.local v1, "DataOggi":Ljava/lang/String;
const/4 v2, 0x0

.line 37
.local v2, "DataOggi_":Ljava/util/Date;
const/4 v0, 0x0

.line 38
.local v0, "DataFinale_":Ljava/util/Date;
new-instance v5, Ljava/text/SimpleDateFormat;

const-string v10, "dd/MM/yyyy"

invoke-direct {v5, v10}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V

.line 42
.local v5, "formatter":Ljava/text/DateFormat;
:try_start_0
invoke-virtual {v5, v1}, Ljava/text/DateFormat;->parse(Ljava/lang/String;)Ljava/util/Date;

move-result-object v2

.line 43
invoke-virtual {v5, p1}, Ljava/text/DateFormat;->parse(Ljava/lang/String;)Ljava/util/Date;
:try_end_0
.catch Ljava/text/ParseException; {:try_start_0 .. :try_end_0} :catch_0

move-result-object v0

.line 47
:goto_1
invoke-virtual {v0, v2}, Ljava/util/Date;->after(Ljava/util/Date;)Z

move-result v10

if-nez v10, :cond_0

.line 50
invoke-virtual {v0, v2}, Ljava/util/Date;->equals(Ljava/lang/Object;)Z

move-result v10

if-nez v10, :cond_0

.line 53
invoke-virtual {v2, v2}, Ljava/util/Date;->before(Ljava/util/Date;)Z

move-result v8

if-eqz v8, :cond_2

move v8, v9

.line 54
goto :goto_0

:cond_2
move v8, v9

.line 57
goto :goto_0

.line 44
:catch_0
move-exception v10

goto :goto_1
.end method
* * *
 
mi spiace ma quello che posti nn lo riconosco cm javascript :(
La prima volta che mi capita di vedere sto javascript, dv lo hai preso? Lo hai scritto tu?
 
mi spiace ma quello che posti nn lo riconosco cm javascript :(
La prima volta che mi capita di vedere sto javascript, dv lo hai preso? Lo hai scritto tu?
No. Io estrapolato i dati di un app android e li ho visualizzati con notepad +++, che lo riconosce javascript. Tra l'altro le apk Android sono programmate con Java.
 
In verità mi sembra possa essere assembly MIPS, ripeto mai visto sto javascript
 

Discussioni simili