Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add day #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions source/datafield/DataFactory.mc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ enum /* FIELD_TYPES */ {

FIELD_TYPE_DATE,
FIELD_TYPE_TIME,
FIELD_TYPE_DAY,
FIELD_TYPE_EMPTY,

FIELD_TYPE_NOTIFICATIONS = 10,
Expand Down Expand Up @@ -65,6 +66,8 @@ function buildFieldObject(type) {
return new DateField(FIELD_TYPE_DATE);
} else if (type==FIELD_TYPE_TIME) {
return new TimeField(FIELD_TYPE_TIME);
} else if (type==FIELD_TYPE_DAY) {
return new DayField(FIELD_TYPE_DAY);
} else if (type==FIELD_TYPE_EMPTY) {
return new EmptyDataField(FIELD_TYPE_EMPTY);
} else if (type==FIELD_TYPE_NOTIFICATIONS) {
Expand Down Expand Up @@ -1289,6 +1292,23 @@ class DateField extends BaseDataField {
}
}

////////////////
// day stage //
////////////////

class DayField extends BaseDataField {

function initialize(id) {
BaseDataField.initialize(id);
}

function cur_label(value) {
var now = Time.now();
var date = Date.info(now, Time.FORMAT_MEDIUM);
return date.day_of_week;
}
}

////////////////////
// end date stage //
////////////////////
Expand Down